#include <stdio.h>
#include <stdlib.h>
int main(){
int fahr, celsius;
int step = 20;
int lower = 0;
int upper = 300;
fahr = lower;
while (fahr <= upper){
celsius = 5 * (fahr - 32) / 9;
printf("%d\t %d\n", fahr, celsius);
fahr += step;
}
system("PAUSE");
}

本文展示了一个使用C语言编写的简单程序,用于将华氏度转换为摄氏度。程序通过循环遍历从0到300度之间的华氏温度,计算对应的摄氏温度,并打印结果。
5566

被折叠的 条评论
为什么被折叠?



