結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー 🐧しゅんチャマ🌸🐧しゅんチャマ🌸
提出日時 2023-09-14 21:30:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 1,926 ms
コンパイル使用メモリ 72,732 KB
実行使用メモリ 56,232 KB
最終ジャッジ日時 2023-09-14 21:30:47
合計ジャッジ時間 6,228 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,228 KB
testcase_01 AC 118 ms
55,708 KB
testcase_02 AC 120 ms
56,064 KB
testcase_03 AC 120 ms
55,720 KB
testcase_04 AC 120 ms
55,524 KB
testcase_05 AC 119 ms
55,780 KB
testcase_06 AC 120 ms
56,112 KB
testcase_07 AC 119 ms
55,580 KB
testcase_08 AC 119 ms
55,904 KB
testcase_09 AC 119 ms
55,660 KB
testcase_10 AC 117 ms
56,232 KB
testcase_11 AC 120 ms
55,960 KB
testcase_12 AC 119 ms
56,128 KB
testcase_13 AC 119 ms
55,720 KB
testcase_14 AC 117 ms
55,736 KB
testcase_15 AC 118 ms
55,604 KB
testcase_16 AC 120 ms
56,016 KB
testcase_17 AC 118 ms
55,868 KB
testcase_18 AC 119 ms
55,620 KB
testcase_19 AC 119 ms
55,812 KB
testcase_20 AC 121 ms
55,980 KB
testcase_21 AC 118 ms
55,408 KB
testcase_22 AC 122 ms
55,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Y9011{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        int sum=0;
        for(int i=0;i<s.length();i++){
            char ch=s.charAt(i);
            sum+=ch-'0';
        }
        System.out.println(sum);
    }
}
0