結果

問題 No.656 ゴルフ
ユーザー tentententen
提出日時 2020-11-12 09:23:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 1,976 ms
コンパイル使用メモリ 71,688 KB
実行使用メモリ 55,992 KB
最終ジャッジ日時 2023-09-30 01:07:28
合計ジャッジ時間 4,012 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,752 KB
testcase_01 AC 119 ms
55,716 KB
testcase_02 AC 119 ms
55,652 KB
testcase_03 AC 120 ms
55,964 KB
testcase_04 AC 118 ms
55,540 KB
testcase_05 AC 119 ms
55,588 KB
testcase_06 AC 119 ms
55,628 KB
testcase_07 AC 118 ms
55,648 KB
testcase_08 AC 119 ms
55,992 KB
testcase_09 AC 119 ms
55,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int score = 0;
        for (char c : sc.next().toCharArray()) {
            if (c == '0') {
                score += 10;
            } else {
                score += c - '0';
            }
        }
        System.out.println(score);
    }
}
0