1115:0 starting point algorithm 22--Fahrenheit Celsius temperature conversion time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:3522 accepted:1456
[Submit] [Status] [Web Board] Description
Enter a temperature of Fahrenheit and calculate the corresponding Celsius temperature according to the formula C= (5/9) (F-32).
Input
Enter a temperature value of Fahrenheit (multiple sets of data)
Output
The output input Fahrenheit temperature and the converted Celsius temperature value.
Input format please refer to sample (one row per group of data)
Sample Input
100
Sample Output
fahr=100.000000,celsius=37.777779
HINT
All data in the calculation use float type Note the notation of the float constant
Source
0 Starting point Learning algorithm
1#include <stdio.h>2 intMain () {3 floatf,c;4 while(SCANF ("%f", &f)! =EOF) {5C=5.0/9* (f +);6printf"fahr=%f,celsius=%f\n", f,c);7 }8 return 0;9}
1115:0 start-up algorithm 22--Fahrenheit Celsius temperature conversion