結果
問題 |
No.9011 数字を全て足そう(数字だけ)
|
ユーザー |
|
提出日時 | 2021-04-07 21:52:23 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 53 ms / 2,000 ms |
コード長 | 501 bytes |
コンパイル時間 | 3,444 ms |
コンパイル使用メモリ | 73,520 KB |
実行使用メモリ | 37,060 KB |
最終ジャッジ日時 | 2024-06-23 02:03:52 |
合計ジャッジ時間 | 5,562 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
import java.io.*; public class Sum { public static void main (String[] args) throws IOException{ try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){ String numString = new String(in.readLine()); in.close(); String[] array = numString.split(""); int sum = 0; for (int i = 0; i < numString.length(); i++){ sum += Integer.parseInt(array[i]); } System.out.println(sum); } catch (IOException e){ // 例外 } } }