結果

問題 No.289 数字を全て足そう
ユーザー hippolover02
提出日時 2022-08-29 17:03:50
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 3,353 ms
コンパイル使用メモリ 84,304 KB
実行使用メモリ 56,368 KB
最終ジャッジ日時 2024-11-06 14:10:51
合計ジャッジ時間 6,953 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int total = 0;
        for (int i = 0; i<line.length(); i++){
            char c = line.charAt(i);
            if(48 <= c && c <= 57){
                int a = c;
                total += a;
            }
        }
        System.out.println(total);
    }
}
0