注意事项: 第一个是华氏度转摄氏度,第二个摄氏度转华氏度。
参考代码:
/*c=5*(f-32)/9 f=c*9/5+32*/
#include<stdio.h>
int main()
{
double f,c;
scanf("%lf",&f);
c=5*(f-32)/9;
printf("c=%0.2lf", c);
return 0; //标准题
}
/*
#include<stdio.h>
int main(){
double f,c;
scanf("%lf",&c);
f=c*9/5+32;
printf("f=%0.2lf",f);
return 0; //拓展题
}
*/
0.0分
8 人评分
#include <stdio.h> int main() { double F; double c; scanf("%lf",&F); printf("%.2f",c=5*(F-32)/9); return 0; } 求指点,感觉和解释差不多,但答案错误
大佬,请问哪里错了 #include<stdio.h> int main() { double f,c=5*(f-32)/9; scanf("%lf",&f); printf("c=%0.2lf", c); return 0; }
1015291114 2021-08-25 20:45:02 |
应该是已经建立了c,f在前,程序运行不会返回,所以你后面的scanf函数无论输入什么都无法回到上面的double f,c=5*(f-32)/9;
大佬可以问一下这个代码有什么问题吗? #include <stdio.h> int main() { double x,y; scanf("%1f",&x); y=5*(x-32)/9; printf("c=%.21f",y); return 0; }
我想当公务员 2021-09-22 00:07:45 |
printf少了个c=
白色枫叶 2021-09-23 08:40:34 |
@fullmoon50 眼瞎qwq,谢谢