将一个整数(0~212范围)的华氏温度(f)转换为摄氏温度(c)。
将一个整数(0~212范围)的华氏温度(f)转换为摄氏温度(c)。用如下公式:
c=5.0*(f-32)/ 9.0
按照右对齐、小数点后保留2位,输出华氏温度f和摄氏温度c,并在数字前面输出正负号。
#include <stdio.h>
int main()
{
float c,f;
printf("Please input the f","f");
c=5.0*(f-32)/ 9.0;
printf("f=%5.2d ,c=%5.2d ",&f,&c);
return 0;
}
这个程序哪里错了
printf("Please input the f:");
scanf("%f",&f);
缺了键盘输入f的过程,另外,整数f被定义成了浮点数。
printf("Please input the f:");
scanf("%f",&f);
缺了键盘输入f的过程
没有这个程序
下一篇:电容器的概念
上一篇:中国留学服务中心是什么行政级别
热门标签: