當前位置:首頁 » 編程語言 » 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
熱點內容
asp搜索源碼 發布:2025-07-03 15:49:55 瀏覽:234
醫美大資料庫 發布:2025-07-03 15:47:07 瀏覽:356
c語言將二進制轉化為十進制 發布:2025-07-03 15:32:47 瀏覽:987
c語言幫助文檔 發布:2025-07-03 15:22:43 瀏覽:319
雙埠存儲器在情況下會發生讀寫沖突 發布:2025-07-03 15:12:54 瀏覽:270
快站資料庫 發布:2025-07-03 14:45:44 瀏覽:39
jsp獲取上傳文件路徑 發布:2025-07-03 14:44:46 瀏覽:569
php時間微妙 發布:2025-07-03 14:39:38 瀏覽:843
巨豆豆手機回復出廠密碼是什麼 發布:2025-07-03 14:35:19 瀏覽:474
演算法的三個 發布:2025-07-03 14:35:19 瀏覽:698