#C14908. Temperature Translator

    ID: 44609 Type: Default 1000ms 256MiB

Temperature Translator

Temperature Translator

This problem requires you to implement a temperature conversion tool. The tool converts a given temperature from Celsius to Fahrenheit or vice versa. The conversion formulas are given by:

For Celsius to Fahrenheit: \(F = \frac{9}{5} \times C + 32\)

For Fahrenheit to Celsius: \(C = \frac{5}{9} \times (F - 32)\)

If an invalid scale is provided (i.e. not 'C' or 'F'), your program should output "Invalid scale".

inputFormat

The input consists of a single line containing a temperature value and a scale separated by a space. The temperature value can be an integer or a float. The scale is a single character: 'C' or 'F'.

Examples:

  • 0 C
  • 32 F

outputFormat

If the scale is valid, output the converted temperature as a float. Otherwise, output the string "Invalid scale".

## sample
0 C
32.0

</p>