更新 '2207/C语言精通120题.md'
This commit is contained in:
parent
073e71187b
commit
5feafc6471
@ -22,7 +22,20 @@ int main(void){
|
|||||||
|
|
||||||
|
|
||||||
2.输入一个华氏温度,要求输出摄氏温度。公式为c=5/9*(f-32)
|
2.输入一个华氏温度,要求输出摄氏温度。公式为c=5/9*(f-32)
|
||||||
|
```c
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void){
|
||||||
|
|
||||||
|
float f, c;
|
||||||
|
scanf("%f", &f);
|
||||||
|
//c = 5.0/9*(f-32);
|
||||||
|
c = (double)5/9*(f-32);
|
||||||
|
printf("%f\n", c);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
3.写一个程序,输入实数X,输出Y,计算<img src="https://yp.smallkun.cn/markdown/image-20250116004443767.png!compress" alt="image-20250116004443767" style="zoom:33%;" />
|
3.写一个程序,输入实数X,输出Y,计算<img src="https://yp.smallkun.cn/markdown/image-20250116004443767.png!compress" alt="image-20250116004443767" style="zoom:33%;" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user