ytu 2029: C语言实验——温度转换(水题)

2029: C语言实验——温度转换

Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 12  Solved: 10
[Submit][Status][Web Board]

Description

输入一个华氏温度,输出摄氏温度,其转换公式为:C=5(F-32)/9。

Input

输入数据只有一个实数,即华氏温度。

Output

输出数据只有一个,即摄氏温度,保留2位有效数字。

Sample Input

32.0

Sample Output

0.00

HINT

 

Source

 1 #include <iostream>
 2 #include <stdio.h>
 3 using namespace std;
 4 
 5 int main()
 6 {
 7     float f;
 8     cin>>f;
 9     f=(5*(f-32))/9;
10     printf("%.2f\n",f);
11     return 0;
12 }

 

 

Freecode : www.cnblogs.com/yym2013

posted @ 2013-12-05 20:37  Freecode#  阅读(572)  评论(0编辑  收藏  举报