第二章例2-6
/* 输出华氏-摄氏温度转换表*/ #include<stdio.h> int main(void) { /*fahr=华氏度, celsius=摄氏度, lower=下限, upper=上限*/ int fahr,lower,upper; double celsius; printf("Enter lower:"); scanf_s("%d",&lower); printf("Enter upper:"); scanf_s("%d",&upper); printf("fahr celsius\n"); for(fahr=lower;fahr<=upper;fahr++){ celsius=(5.0/9.0)*(fahr-32); printf("%d%6.1f\n",fahr,celsius); } return 0; }