[問題] 測資過不了..~"~

看板C_and_CPP作者 (heymei)時間13年前 (2011/10/14 07:13), 編輯推噓1(106)
留言7則, 4人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) C 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) no 問題(Question): 測資可以過幾筆,但有幾筆也過不了.但不曉得原因..Orz 問題1: 題目是Sum of digits,但0不算一個數字。 ex:input=>999 out =>3 ,input=>200 output=>1 格式:input:The first line contains the only integer n(0≦n≦10^100000) output:跟上面一樣 問題二: 題目是判斷是否lucky number,4和7,即一串數字中,數字只能是4或者7形成的集合 ex:input 44777 output:YES , input:1000 output:NO 格式:input:輸入的n範圍在0到10^18 餵入的資料(Input): 不知測資系統餵入的資料 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) 問題1:http://codepad.org/H4sMK9J9 問題2:http://codepad.org/AU9Zb4h0 補充說明(Supplement): 謝謝>"< -- ※ 發信站 :批踢踢實業坊(ptt.cc) ◆ From: 140.113.190.57

10/14 15:42, , 1F
你第一個只能計算有幾個不是 '0'
10/14 15:42, 1F

10/14 15:49, , 2F
好歹也把題目敘述打成標題, 你把問題都focus在"過不過
10/14 15:49, 2F

10/14 15:49, , 3F
scanf("%s",&num); 似乎有錯
10/14 15:49, 3F

10/14 15:50, , 4F
"沒有去了解題目要求, 所以才會解決不了
10/14 15:50, 4F

10/14 17:30, , 5F
Sum of digits是什麼意思@@ 為什麼999的輸出不是27 ?
10/14 17:30, 5F

10/14 17:34, , 6F
第一題題目可能要改 count of digits,expect zero.
10/14 17:34, 6F

10/14 17:55, , 7F
我想我看出來問題出在哪了.. 第一次寫真的易漏溝。
10/14 17:55, 7F
文章代碼(AID): #1Eb-3zPz (C_and_CPP)