我的一个小程序,不知道哪儿有问题
程序代码:
#include <STDIO.H> void temperatures(double n); int main(void) { double fah = 0.0; //char c; printf("enter a far temperature(press q to quit):"); while (scanf("%f", &fah) ) { temperatures(fah); printf("enter another far(press q to quit):"); } printf("done!\n"); return 0; } void temperatures(double n) { const double k = 1.8; const double b = 32.0; const double mod = 273.16; double cel, kel; cel = k * n + b; kel = cel + mod; printf("temprature are %.2fF, %.2fC, %.2fK.\n", n, cel, kel); }要求是输入一个华氏温度,求出摄氏度,绝对温度。我不管怎么输进去,不变。。。好像没传进去
[ 本帖最后由 迷途的菜鸟 于 2012-8-13 22:05 编辑 ]