結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー ウップス600ウップス600
提出日時 2022-01-04 20:43:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 3,026 ms
コンパイル使用メモリ 74,332 KB
実行使用メモリ 41,588 KB
最終ジャッジ日時 2024-04-22 17:34:02
合計ジャッジ時間 7,684 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
41,120 KB
testcase_01 AC 143 ms
41,140 KB
testcase_02 AC 146 ms
41,316 KB
testcase_03 AC 145 ms
41,520 KB
testcase_04 AC 147 ms
41,376 KB
testcase_05 AC 142 ms
41,260 KB
testcase_06 AC 142 ms
41,144 KB
testcase_07 AC 147 ms
41,216 KB
testcase_08 AC 153 ms
41,524 KB
testcase_09 AC 143 ms
41,016 KB
testcase_10 AC 147 ms
41,500 KB
testcase_11 AC 147 ms
41,356 KB
testcase_12 AC 143 ms
40,888 KB
testcase_13 AC 142 ms
41,272 KB
testcase_14 AC 148 ms
41,336 KB
testcase_15 AC 147 ms
41,056 KB
testcase_16 AC 146 ms
41,288 KB
testcase_17 AC 144 ms
41,280 KB
testcase_18 AC 144 ms
41,588 KB
testcase_19 AC 147 ms
41,016 KB
testcase_20 AC 148 ms
41,168 KB
testcase_21 AC 146 ms
41,240 KB
testcase_22 AC 143 ms
41,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java. util. Scanner;

public class Main{
	public static void main (String[] args){
		Scanner scanner = new Scanner (System. in);
		
		String number = scanner. next();
		
		int x = 0;
		String[] count = number. split ("");
		
		for (int j = 0; j < number. length(); j ++){
			Integer a = Integer. parseInt (count[j]);
			x += a;
		}
		System. out. println (x);
	}
}
0