输入一个华氏温度,要求输出摄氏温度。
公式为c=5/9(F-32) 输出要有文字说明,取2位小数。
答案字数较多,建议语音阅读
正确的程序 调试通过! 符合你的要求! #include void main(void) { float c,F; printf("请输入华氏温度:"); scanf("%f",F); c=5/(9*(F-32)); printf("对应摄氏温度为%.2f",c); //取2位小数 }
标准答案: #include main() { double tem_c, tem_f; puts("=====华氏温度至摄氏温度转换程序====="); printf("请输入华氏温度:"); scanf("%lf", &tem_f); tem_c = (tem_f - 12) * 5.0 / 9.0; printf("%f对应的摄氏温度为%.2f", tem_f, tem_c); renturn 0;
#include void main(void) { float c,F; printf("Please input 华氏温度:"); scanf("%f",F); c=5/(9*(F-32)); printf("对应摄氏温度为%f",c); }
#include void main(void) { float c,F; printf("Please input 华氏温度:"); scanf("%f",F); c=5/(9*(F-32)); printf("对应摄氏温度为%f",c); }
答:1C = (F- 32)* 5/9 C:centigrade 摄氏度 F:Fahrenheit 华氏度详情>>
问:挺简单的一C函数,不过我是初学者,暂时还不会写,请好心人多多帮忙!
答:int mystrlen(char *str) { int n = 0; while (*str) { n++; str++;} return n; } voi...详情>>