[問題] C++讀檔換行問題
開發平台(Platform): (Ex: Win10, Linux, ...)
Win10
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
Code block
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):讀檔換行,希望一次讀一行到矩陣中,下一次iteration再讀第二行進
來同樣的矩陣中,進行預算
餵入的資料(Input):
55 148 532
23 72 455
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
for(iteration=0;iterations<2;iteration++)
for(i=0;i<3;i++)
infile >> a[i] ;
....
補充說明(Supplement):
想請問各位大大,使用infile >> 有什麼指令有辦法直接換行嗎?謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.136.53.53
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1541596839.A.EDB.html
→
11/07 21:45,
7年前
, 1F
11/07 21:45, 1F
→
11/07 23:48,
7年前
, 2F
11/07 23:48, 2F
→
11/07 23:48,
7年前
, 3F
11/07 23:48, 3F
推
11/07 23:52,
7年前
, 4F
11/07 23:52, 4F
→
11/07 23:52,
7年前
, 5F
11/07 23:52, 5F
→
11/08 22:37,
7年前
, 6F
11/08 22:37, 6F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章