float weight;
float value;
printf("Are you worth your wight in rhodium?\n");
printf("Let's check it out.\n");
printf("Please enter your wight in pounds: ");
scanf("%f",&wight);
value = 770 * wight * 14.5833;
printf("Your wight in rhodium is worth $%.2f.\n",value);
peintf("You are easily worth that! If rhodium prices drop.\n");
printf("Eat more to maintain your value.\n");
return 0;
}
为什么打不开
--------------------Configuration: cDame - Win32 Debug--------------------
Compiling...
rhodium.c
e:\新建文件夹\cdame\rhodium.c(16) : fatal error C1010: unexpected end of file while looking for precompiled header directive
执行 cl.exe 时出错.
cDame.exe - 1 error(s), 0 warning(s)
我的报错和你的不一样。
我改了几个地方:
float->double
scanf里面的%f->%lf
你的weight后面的都写成了wight