[問題] 想請問這個方程式
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
c++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
/*prog3_4*/
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
double f,c;
printf("請輸入華氏溫度:");
scanf("%1f",&f);
c=(f-32)*(5/9.0);
printf("攝氏溫度%.2f=華氏溫度%.2f",c,f);
system("pause");
return 0;
}
這是我的程式碼 可是執行出來數字都是錯誤的
不知道是哪邊有錯誤
另外關於溫度的方程式
華式=(9/5.0)*攝氏+32;
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
補充說明(Supplement):
--
小本經營賣場 http://tw.user.bid.yahoo.com/tw/user/Y2286184456
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.33.47.144
→
08/30 17:46, , 1F
08/30 17:46, 1F
→
08/30 18:03, , 2F
08/30 18:03, 2F
→
08/30 18:04, , 3F
08/30 18:04, 3F
→
08/30 18:05, , 4F
08/30 18:05, 4F
→
08/30 18:05, , 5F
08/30 18:05, 5F
→
08/30 18:11, , 6F
08/30 18:11, 6F
→
08/30 19:12, , 7F
08/30 19:12, 7F
→
08/30 22:54, , 8F
08/30 22:54, 8F
→
08/30 23:27, , 9F
08/30 23:27, 9F
→
08/30 23:40, , 10F
08/30 23:40, 10F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章