結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー yagi2yagi2
提出日時 2017-04-25 17:51:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 3,147 ms
コンパイル使用メモリ 73,980 KB
実行使用メモリ 41,340 KB
最終ジャッジ日時 2024-04-21 21:43:31
合計ジャッジ時間 6,707 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,340 KB
testcase_01 AC 124 ms
41,024 KB
testcase_02 AC 113 ms
40,212 KB
testcase_03 AC 128 ms
41,284 KB
testcase_04 AC 129 ms
41,196 KB
testcase_05 AC 125 ms
41,288 KB
testcase_06 AC 126 ms
41,004 KB
testcase_07 AC 127 ms
41,264 KB
testcase_08 AC 125 ms
41,012 KB
testcase_09 AC 126 ms
41,040 KB
testcase_10 AC 127 ms
41,240 KB
testcase_11 AC 124 ms
41,284 KB
testcase_12 AC 124 ms
41,240 KB
testcase_13 AC 126 ms
41,128 KB
testcase_14 AC 126 ms
41,312 KB
testcase_15 AC 126 ms
41,072 KB
testcase_16 AC 130 ms
41,240 KB
testcase_17 AC 126 ms
41,028 KB
testcase_18 AC 124 ms
41,248 KB
testcase_19 AC 126 ms
41,040 KB
testcase_20 AC 125 ms
41,264 KB
testcase_21 AC 142 ms
41,212 KB
testcase_22 AC 127 ms
41,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int sum = 0;
        for (String s : sc.next().split("")) {
            sum += Integer.parseInt(s);
        }
        System.out.println(sum);
    }
}
0