C语言实验——温度转换
Time Limit: 1000MS Memory Limit: 65536KB
Problem Description
输入一个华氏温度,输出摄氏温度,其转换公式为:C=5(F-32)/9。
Input
输入数据只有一个实数,即华氏温度。
Output
输出数据只有一个,即摄氏温度,保留2位小数。
Example Input
32.0
Example Output
0.00
Hint
Author
参考代码
#include <stdio.h>
int main()
{
float f=0.0;
float c=0.0;
scanf("%f",&f);
c = 5 * (f-32) / 9;
printf("%.2f",c);
return 0;
}