結果

問題 No.289 数字を全て足そう
ユーザー cande398cande398
提出日時 2017-10-10 17:30:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 262 ms / 1,000 ms
コード長 291 bytes
コンパイル時間 2,080 ms
コンパイル使用メモリ 74,268 KB
実行使用メモリ 59,656 KB
最終ジャッジ日時 2024-04-28 15:28:14
合計ジャッジ時間 7,680 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
54,164 KB
testcase_01 AC 120 ms
53,920 KB
testcase_02 AC 121 ms
53,916 KB
testcase_03 AC 122 ms
53,884 KB
testcase_04 AC 126 ms
54,032 KB
testcase_05 AC 217 ms
57,536 KB
testcase_06 AC 197 ms
57,200 KB
testcase_07 AC 250 ms
59,440 KB
testcase_08 AC 226 ms
59,536 KB
testcase_09 AC 193 ms
57,604 KB
testcase_10 AC 224 ms
59,268 KB
testcase_11 AC 244 ms
59,224 KB
testcase_12 AC 245 ms
58,932 KB
testcase_13 AC 235 ms
59,564 KB
testcase_14 AC 252 ms
59,224 KB
testcase_15 AC 242 ms
59,240 KB
testcase_16 AC 224 ms
58,788 KB
testcase_17 AC 243 ms
59,656 KB
testcase_18 AC 262 ms
58,832 KB
testcase_19 AC 253 ms
59,448 KB
testcase_20 AC 243 ms
58,196 KB
testcase_21 AC 110 ms
52,940 KB
testcase_22 AC 257 ms
58,860 KB
testcase_23 AC 222 ms
57,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

public class Main{
  public static void main(String[] args){
    String[] line = new java.util.Scanner(System.in).next().split("");
    int sum = 0;
    for(int i=0;i<line.length;i++){
      sum += Integer.parseInt(line[i].replaceAll("[^0-9]","0"));
    }
    System.out.println(sum);
  }
}
0