[問題] 排列數字有誤
開發平台(Platform): (Ex: Win10, Linux, ...)
Win10
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
c++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
在排列數字的時候找不到正確的值
餵入的資料(Input):
56 89 67 101
預期的正確結果(Expected Output):
89 67 56
錯誤結果(Wrong Output):
101 0 0
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
https://ideone.com/h9JHp5
補充說明(Supplement):
排列數字的時候有錯
找不到原因
最大值都是101
往下排列數字都是0
阿不然就是溢位(-85640)
麻煩各位幫我debug~~~感恩
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.115.152.91 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1642493845.A.BAA.html
→
, , 1F
01/18 17:18
你的意思是說不能用while 的意思嗎!
※ 編輯: jerryhey (140.115.152.91 臺灣), 01/18/2022 18:00:29
→
01/18 18:28,
2年前
, 2F
01/18 18:28, 2F
我試試!
這樣變成總分平均變成0了
※ 編輯: jerryhey (101.136.223.73
臺灣), 01/18/2022 18:37:23
※ 編輯: jerryhey (101.136.223.73 臺灣), 01/18/2022 19:14:15
※ 編輯: jerryhey (101.136.223.73 臺灣), 01/18/2022 19:22:01
→
01/18 19:24,
2年前
, 3F
01/18 19:24, 3F
→
01/19 00:46,
2年前
, 4F
01/19 00:46, 4F
→
01/19 00:46,
2年前
, 5F
01/19 00:46, 5F
→
01/19 00:46,
2年前
, 6F
01/19 00:46, 6F
→
01/19 00:46,
2年前
, 7F
01/19 00:46, 7F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章