ScratchData LogoScratchData
Back to misgdps's profile

a069:所有位數和

MImisgdps•Created September 2, 2015
a069:所有位數和
0
0
103 views
View on Scratch

Description

a024: 所有位數和關鍵字: while 迴圈 測資點 : 5 | 時間限制 : 1000 ms | 記憶體限制 : 32000 KB 通過 : 2071 次 / 2002 人 | 送出 : 2712 次 / 2043 人 | 通過比率 : 98% 題目加入時間 : 2011-08-15 15:18 內容: 简体中文 給你一個正整數,請你求出所有位數的和是多少,例如12345,因為1+2+3+4+5=15,則輸出15。 輸入說明: 請輸入一個正整數 N。 輸出說明: 請輸出 N 所有位數的和是多少。 範例輸入:help 12345 1997 範例輸出 : 15 26 提示 : 可以用另一個變數 S 去記錄位數和是多少,觀察下面 N、S 兩個變數的變化: N -> 12345 -> 1234 -> 123 -> 12 -> 1 -> 0 S -> 0 -> 5 -> 9 -> 12 -> 14 -> 15 出處 : while 迴圈 (管理員:sagit)

Project Details

Project ID75078528
CreatedSeptember 2, 2015
Last ModifiedSeptember 3, 2015
SharedSeptember 2, 2015
Visibilityvisible
CommentsAllowed