[問題] scanf跟gets
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
win7 64bit
CodeBlocks 10.5
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
如果gets()在scanf()下面就沒辦法正常輸入
想知道為什麼會這樣?
餵入的資料(Input):
1
ABC
預期的正確結果(Expected Output):
ABC
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/36klSzjN
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.205.55.3
推
12/04 15:21, , 1F
12/04 15:21, 1F
→
12/04 15:21, , 2F
12/04 15:21, 2F
→
12/04 15:22, , 3F
12/04 15:22, 3F
→
12/04 15:22, , 4F
12/04 15:22, 4F
→
12/04 15:22, , 5F
12/04 15:22, 5F
謝謝f大 \(^▽^)/
原來gets跟scanf斷開的地方不一樣 ^^
※ 編輯: BombCat 來自: 123.205.55.3 (12/04 15:31)
推
12/04 15:32, , 6F
12/04 15:32, 6F
→
12/04 15:33, , 7F
12/04 15:33, 7F
推
12/04 15:50, , 8F
12/04 15:50, 8F
→
12/04 17:37, , 9F
12/04 17:37, 9F
→
12/04 17:41, , 10F
12/04 17:41, 10F
→
12/04 20:10, , 11F
12/04 20:10, 11F