看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: Win10, Linux, ...) linux 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 大家好(我又來問了) 我寫了一個叫做 writeFileout的class, 它的工作是把從filein.txt的原始數據讀下來, 算一算之後把結果寫入fileout.txt。 它在讀第一第二行時都好好的, 第三行開始讀讀不到, 第四行以後我用while讀,讀不到。 餵入的資料(Input): k r1 r2 32 1613 1609 sa sb 0 1 0.5 0.5 0.5 0.5 0 1 0 1 0 1 預期的正確結果(Expected Output): 1613 1609 1597 1625 1598 1624 1599 1623 etc. 錯誤結果(Wrong Output): 1613 1609(只有這一行) 過程中沒有出現error message 程式碼(Code):(請善用置底文網頁, 記得排版) main.cpp: https://codepad.remoteinterview.io/NNVEBORFWE R.h R.cpp(算R值的class): https://codepad.remoteinterview.io/YRFWYAJZJJ writeFileout.h writeFileout.cpp(讀原始資料,計算後寫入fileout.txt): https://codepad.remoteinterview.io/TDWXCJYVMQ (問題出在第49行以後,用cout印看看發現都沒有印出來) writeFilein.h writeFilein.cpp(將原始數據寫進filein.txt): https://codepad.remoteinterview.io/TUVBALUDQH (36行開始輸入) 補充說明(Supplement): 這裡是在算elo rate -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.238.194.129 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1490935679.A.B41.html ※ 編輯: franklin1997 (36.238.194.129), 03/31/2017 13:05:22
steve1012: 用手機看不到code 03/31 13:49
拍謝 因為覺得程式有點大所以放在pad上 沒想到會有這樣的問題 已經解決了,謝謝大大抽空來看 也謝謝幫我的大師 ※ 編輯: franklin1997 (36.238.194.129), 03/31/2017 14:49:11
Ommm5566: 你的code全部貼錯 04/01 14:39
energyy1104: 這數據怎麼跟我們的作業一模一樣... 04/06 13:57