输入一个华氏温度,要求输出相应的摄氏温度。转换公式为:C=5/9(F-32) 用C语言怎么写啊,请高手赐教下, 输入一个华氏温度,要求输出摄氏温度。公式为 c=5(F-32...
C\u8bed\u8a00 \u8f93\u5165\u4e00\u4e2a\u534e\u6c0f\u6e29\u5ea6f\uff0c\u8981\u6c42\u8f93\u51fa\u6444\u6c0f\u6e29\u5ea6c\uff0c\u516c\u5f0f\u4e3ac=5/9\uff08f-32\uff09\uff1b\u8f93int main()
{
float f,c;
scanf("%f",&f);
c=5.0/9*(f-32);
printf("%0.2f",c);
}
1\u3001\u53ef\u4ee5\u662fpython\u8bed\u8a00\u7f16\u5199\uff0c\u5206\u6790\u5982\u4e0b\uff1a
(1) \u8f93\u5165\u8f93\u51fa\u7684\u6444\u6c0f\u5ea6\u91c7\u7528\u5b57\u6bcdC\u3001c\u5f00\u5934\uff0c\u6e29\u5ea6\u53ef\u4ee5\u662f\u6574\u6570\u6216\u5c0f\u6570\uff0c\u5982\uff1aC12.34\u6307\u6444\u6c0f\u5ea612.34\u5ea6\uff1b
(2) \u8f93\u5165\u8f93\u51fa\u7684\u534e\u6c0f\u5ea6\u91c7\u7528\u5b57\u6bcdF\u3001f\u5f00\u5934\uff0c\u6e29\u5ea6\u53ef\u4ee5\u662f\u6574\u6570\u6216\u5c0f\u6570\uff0c\u5982\uff1aF87.65\u6307\u6444\u6c0f\u5ea687.65\u5ea6\uff1b
2\u3001\u5177\u4f53\u7f16\u5199\u7684python\u7a0b\u5e8f\u622a\u56fe
3\u3001\u7a0b\u5e8f\u5982\u4e0b\uff0c\u6ce8\u610ftab\u5efa\u7f29\u8fdb\u4e00\u81f4\uff0c\u5426\u5219\u62a5\u9519
temp = input("\u8bf7\u8f93\u5165\u5e26\u6709\u7b26\u53f7\u7684\u6e29\u5ea6\u503c\uff1a")
if temp[-1] in ['F', 'f']:
C = (eval(temp[0:-1]) - 32)/1.8
print("\u8f6c\u6362\u540e\u7684\u6e29\u5ea6\u662f{:.2f}C" .format(C))
elif temp[-1] in ['C', 'c']:
F = 1.8*eval(temp[0:-1]) + 32
print("\u8f6c\u6362\u540e\u7684\u6e29\u5ea6\u662f{:.2f}F" .format(F))
else:
print("\u8f93\u5165\u683c\u5f0f\u9519\u8bef\uff01")
4\u3001\u8f93\u5165\u534e\u6c0f\u5ea6\u7ed3\u679c\u622a\u56fe
5\u3001\u8f93\u5165\u6444\u6c0f\u5ea6\u7ed3\u679c\u622a\u56fe
6\u3001\u8f93\u5165\u9519\u8bef\u5185\u5bb9\u7ed3\u679c\u622a\u56fe
void main(){
float c,f;
scanf("%f",&f);
c=5.0/9*(e-32);
printf("%f",c);
}
#include <stdio.h>
void main()
{
int f=0;
scan("%d", &f);
int c=5/9(f-32);
printf("%d", c);
}
c=摄氏度
摄氏度=九分之五乘(华氏度-32)
绛旓細鍏蜂綋鍏紡濡備笅锛歩nclude <stdio.h> void main(){ float c,f;printf("璇杈撳叆涓涓崕姘忔俯搴\n");scanf("%f",&f);c=(f-32)*5/9;printf("瀹冪殑鎽勬皬娓╁害涓:%.2f",c);}
绛旓細int main(){ float c,f;printf("please input the f=");scanf("%f",&f);c=5/9*(f-32);printf("the c=%f",c);}
绛旓細鍙互鍙傝冧笅闈㈢殑浠g爜锛歩nclude <stdio.h> int main(void){ float c,f;printf("璇杈撳叆涓涓崕姘忔俯搴:\n");scanf("%f",&f);c=(f-32)*5/9;printf("瀵瑰簲鐨勬憚姘忔俯搴︽槸:%.2f\n",c);}
绛旓細缂栧啓绋嬪簭,杈撳叆涓涓崕姘忔俯搴,瑕佹眰杈撳嚭鎽勬皬娓╁害.鍏紡c=5/9*(f-32) 鎴戞潵绛 1涓洖绛 #鍥藉簡蹇呯湅# 鍏ㄥ娓稿浣曚綋楠屽绉嶇帺娉?鎴峰涔9318 2022-09-12 路 TA鑾峰緱瓒呰繃373涓禐 鐭ラ亾灏忔湁寤烘爲绛斾富 鍥炵瓟閲:96 閲囩撼鐜:50% 甯姪鐨勪汉:23.8涓 鎴戜篃鍘荤瓟棰樿闂釜浜洪〉 ...
绛旓細include <io.stream> using namespace std;float a=5/9;float Ftem(float F) { return (F-32)*a;} void main() { float x,y;cout<<"Enter the F temperature: \n";cin>>x;y=Ftem(x);cout<<"The C temperature is "<<y<<endl;} ...
绛旓細杈撳叆涓涓崕姘忔俯搴F锛岃姹傝緭鍑鎽勬皬娓╁害C銆傞氳繃绋嬪簭鏉ヨ绠楀紡瀛:(a + b)*c/(d*d - e*e*e)銆傛憚姘忓害鍗庢皬搴︿箣闂寸殑鍏崇郴锛氭憚姘忔俯搴︼紙鈩冿級鍜屽崕姘忔俯搴︼紙鈩夛級涔嬮棿鐨勬崲绠楀叧绯讳负锛 鍗庢皬搴=鎽勬皬搴γ1.8+32 鎽勬皬搴=(鍗庢皬搴-32)梅1.8 5(鍗庢皬搴-50)=9(鎽勬皬搴-10)銆傛敞鎰忥細鑻涓鍗庢皬娓╁害锛C涓烘憚姘...
绛旓細include <stdio.h>int main(){ double c, f; printf ("璇杈撳叆鍗庢皬娓╁害锛"); scanf ("%lf", &f); c=5.0/9*(f-32); printf ("%g鍗庢皬娓╁害鏄%.2f鎽勬皬娓╁害\n", f, c); return 0;}
绛旓細銆愮瓟妗堛戯細Public Sub p1()Dim f As Single锛宑 As Single f=InputBox("璇杈撳叆鍗庢皬娓╁害锛")C=5*(f-32)/9 MsgBox"鎽勬皬娓╁害涓猴細"&c End Sub鏈鑰冩煡鐨勭煡璇嗙偣鏄緭鍏ュ嚱鏁癐nputBox鍜杈撳嚭鍑芥暟MsgBox鐨勪娇鐢紝浠ュ強琛ㄨ揪寮忕殑姝g‘涔﹀啓銆傝杩囩▼杩愯鏃跺彉閲廸淇濆瓨宸茬煡鐨鍗庢皬娓╁害锛鍙橀噺C淇濆瓨璁$畻鐨勭粨鏋滄憚姘忔俯搴︺
绛旓細include <stdio.h> int main(){ float f,F;scanf("%f",&F);f=(5.0/9)*F;printf("%f\n",f);return 0;}
绛旓細include<stdio.h> void main(){ float c,f;printf("\n璇杈撳叆鍗庢皬娓╁害(F):");scanf("%f",&f);c=(f-32)*5/9;printf("\n鍗庢皬娓╁害 %1.2f 瀵瑰簲鐨勬憚姘忔俯搴︿负: %1.2f\n",f,c);}