[問題] ACM10 The 3n+1 problem

看板C_and_CPP (C/C++)作者 (Keysholic)時間14年前 (2011/10/17 16:21), 編輯推噓0(004)
留言4則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Code::Blocks 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) NO 問題(Question): 今天第一次做ACM的題目就卡關... 我有測試過很多筆資料,輸出的答案和下面的網站一樣 http://uvatoolkit.com/problemssolve.php 但是上傳到下面兩個網站總是回傳Wrong Answer http://www.programming-challenges.com/ http://uva.onlinejudge.org/ 已經檢查到不知道該檢查甚麼了... 希望各位前輩能幫忙看看究竟是哪裡出了錯 餵入的資料(Input):s 221 304 38 849 367 509 362 856 160 968 611 787 535 618 740 764 125 714 926 476 預期的正確結果(Expected Output): 221 304 128 38 849 171 367 509 142 362 856 171 160 968 179 611 787 171 535 618 137 740 764 153 125 714 171 926 476 179 錯誤結果(Wrong Output): Wrong Answer 程式碼(Code):(請善用置底文網頁, 記得排版) http://codepad.org/RwQzqykD 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.199.129

10/17 16:39, , 1F
The integers i and j must appear in the output in the
10/17 16:39, 1F

10/17 16:40, , 2F
same order in which they appeared in the input
10/17 16:40, 2F

10/17 16:41, , 3F
改了以後就可以 AC 了 <== 有幫你上傳過了
10/17 16:41, 3F
※ 編輯: Keysholic 來自: 140.111.129.79 (10/17 16:56)

10/17 16:57, , 4F
原來是自己粗心沒看清楚題目... 感謝你的幫忙!!
10/17 16:57, 4F
文章代碼(AID): #1Ec-LkKy (C_and_CPP)
文章代碼(AID): #1Ec-LkKy (C_and_CPP)