[問題] uva548已ac但在線上編譯器卻無法執行?

看板C_and_CPP作者 (美麗新世界)時間9年前 (2016/02/20 21:56), 編輯推噓1(105)
留言6則, 3人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 雖然在uva官網和自己的編譯器vc2010都可以執行 但在線上ide 卻怎麼樣都不能執行 有點在意 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): runtime error 程式碼(Code):(請善用置底文網頁, 記得排版) https://ideone.com/r2xFe1 補充說明(Supplement): 題目 http://luckycat.kshs.kh.edu.tw/homework/q548.htm -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 219.86.201.154 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1455976601.A.A0E.html

02/20 22:16, , 1F
memset不是這樣用的
02/20 22:16, 1F

02/20 22:20, , 2F
只要不是POD type,你弄memset都有出錯的可能性
02/20 22:20, 2F

02/20 22:35, , 3F
另外,你這份code有很多問題,你最好找C++的書來看一下
02/20 22:35, 3F

02/21 00:19, , 4F
了解
02/21 00:19, 4F

02/22 18:15, , 5F
我原本還在想memset(s, 0, sizeof(s));哪裡錯了
02/22 18:15, 5F

02/22 18:15, , 6F
結果之後看main才發現他把string陣列拿去memset...
02/22 18:15, 6F
文章代碼(AID): #1Mo72PeE (C_and_CPP)