#include <stdio.h>
void main()
{
float fahr, celsius;
int lower, upper, step;
lower = 0;
upper = 300;
step = 20;
fahr = lower; /*lower是整形int的,而fhar是浮点型folat的,需要把lower强制转换成folat型,相同类型才可以把lower赋值给fahr*/
printf("华氏温度转摄氏温度\n");
while (fahr <= upper) {
celsius = (5.0/9.0)*(fahr-32.0);
prinft("%3.0f\t%6.1f\n",fahr,celsius); /*错误的拼写prinft=printf*/
fahr = fahr + step;
}
}