為什么我求的這個(gè)程序無法運(yùn)行,求c語言方法解答!
題目:寫一個(gè)程序,打印相應(yīng)的攝氏華氏度
(write a program to print the corresponding Celsius to Fahrenheit table)
我的解答:
#include<stdio.h>
int main()
{
???? float Celsius,Fahrenheit;
???? Fahrenheit==32+1.8*Celsius;
???? printf("%.1f\n",Fahrenheit);
???? return 0;
}
2016-10-12
2016-10-13
你沒有用
scanf輸入變量數(shù)據(jù)
2016-10-13
“==”是進(jìn)行判斷,“=”是賦值
2016-10-12
并沒有錯(cuò),應(yīng)該是你在輸入數(shù)據(jù)時(shí)有錯(cuò)吧!
2016-10-12
? #include <stdio.h>
??? void main()
??? {
??????? float F,C;
???????
??????? printf("需要轉(zhuǎn)換的華氏溫度:");
??????? scanf("%f",&F);
???????
??????? C = (F-32)*5/9.0;
???????
??????? printf("對(duì)應(yīng)的攝氏溫度為:%.2f \n",C);
???? }