#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int i; int fahr,celsius; int lower,upper,step; lower = 0;//温度表的下限 upper = 300;//温度表的上限 step = 20;//步长 fahr = lower; while(fahr<=upper){ celsius = 5 *(fahr-32)/9; printf("%d\t%d\n",fahr,celsius); fahr=fahr+step; } scanf("%s",&i); return 0; }