當前位置:首頁 » 編程語言 » C語言tf

C語言tf

發布時間: 2024-11-15 14:36:22

⑴ C語言中,怎麼輸入華氏溫度F,按公式計算並輸出對應的攝氏溫度C

{
float f=0.0;
printf("Please input the fahrenheit degree: ");
scanf("%f",&f);
printf("%fF=%.2fC",f,(5/9)*(f-32)));
system("pause");
return 0;
}

⑵ 如何編寫一個華氏攝氏度與攝氏溫度之間的C語言轉換程序

C語言程序:

#include<stdio.h>

intmain()
{
doublef,c;

printf("請輸入攝氏溫度值:");
scanf("%lf",&c);
f=9.0/5*c+32;
printf("華氏溫度值:%lf ",f);

printf("請輸入華氏溫度值:");
scanf("%lf",&f);
c=(f-32)*5/9;
printf("攝氏溫度值:%lf ",c);

return0;
}


運行測試:

請輸入攝氏溫度值:35
華氏溫度值:95.000000
請輸入華氏溫度值:95
攝氏溫度值:35.000000
熱點內容
root腳本和免root腳本 發布:2025-03-18 22:04:17 瀏覽:505
怎麼弄黑框字體安卓 發布:2025-03-18 22:04:14 瀏覽:173
怎麼知道我的世界伺服器的密碼 發布:2025-03-18 21:43:48 瀏覽:177
android專家 發布:2025-03-18 21:41:16 瀏覽:802
白酒怎麼存儲 發布:2025-03-18 21:40:32 瀏覽:122
電腦怎麼破開機密碼 發布:2025-03-18 21:40:32 瀏覽:598
小米如何顯示wifi密碼 發布:2025-03-18 21:27:07 瀏覽:753
python中的ord 發布:2025-03-18 21:20:11 瀏覽:324
qq網源碼 發布:2025-03-18 21:19:19 瀏覽:558
收款源碼 發布:2025-03-18 21:18:39 瀏覽:753