結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
|
提出日時 | 2021-03-09 19:00:27 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 74 ms / 1,000 ms |
コード長 | 484 bytes |
コンパイル時間 | 5,812 ms |
コンパイル使用メモリ | 73,480 KB |
実行使用メモリ | 37,864 KB |
最終ジャッジ日時 | 2024-10-11 12:31:00 |
合計ジャッジ時間 | 6,394 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No00000289_Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); int sum = 0; for(int i = 0; i < str.length(); i++) { char c = str.charAt(i); if('0' <= c && c <= '9') sum +=Integer.parseInt(String.valueOf(c)); } System.out.println(sum); } }