-->
当前位置:首页 > 题库

PROGRAMMING:Output Fahrenheit centigrade temperature conversion table [1]

Luz5年前 (2021-05-10)题库410
Enter $$2 $$positive integers $$lower $$and $$upper $$(lower $$Le $$upper $$$Le $$100), please output a Fahrenheit centigrade temperature conversion table with the value range of [$$lower $$, $$upper $$], and each increment of $$1 $$Fahrenheit.
Calculation formula of temperature conversion: $$C = 5 times (F - 32) / 9 $$, where: $$C $$represents centigrade temperature and $$f $$represents Fahrenheit temperature.
###Input format:
Enter $$2 $$integers on one line to represent the values of $$lower $$and $$upper $$, separated by spaces.
###Output format:
The first line outputs the following with a space in the middle.
```
fahr celsius
```
Next, output one Fahrenheit temperature $$Fahr $$(integer, 4 characters wide, right aligned) and one centigrade temperature $$Celsius $$(real, 6 characters wide, right aligned, 1 decimal place).
If the input range is illegal, output 'invalid.'.
###Input sample 1:
```in
31 33
```
###Output sample 1:
```out
fahr celsius
31 -0.6
32 0.0
33 0.6
```
###Input sample 2:
```in
40 30
```
###Output sample 2:
```out
Invalid.
```







answer:If there is no answer, please comment