#以下为代码
#include
int main()
{
printf("华氏度\t摄氏度\n");
int a = 0 ;
while (a<301)
{
float b = (a-32)/1.8 ;
printf("%d\t%.1f\n",a,b);
a = a + 20 ;
}
return 0 ;
}
#以下为输出结果
华氏度 摄氏度
0 -17.8
20 -6.7
40 4.4
60 15.6
80 26.7
100 37.8
120 48.9
140 60.0
160 71.1
180 82.2
200 93.3
220 104.4
240 115.6
260 126.7
280 137.8
300 148.9
#网站禁止使用相同符号,以图片为准
输出语句这么改:printf("%-4d\t%-6.1f\n", a, b);