結果

問題 No.656 ゴルフ
ユーザー Dakini
提出日時 2018-03-12 23:08:44
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 2,799 ms
コンパイル使用メモリ 73,836 KB
実行使用メモリ 41,300 KB
最終ジャッジ日時 2024-11-15 18:09:23
合計ジャッジ時間 5,071 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Q656 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] c = s.toCharArray();
        int result = 0;
        for(int i = 0; i<9; i++) {
            if(Character.getNumericValue(c[i]) == 0) {
                result += 10;
            } else {
                result += Character.getNumericValue(c[i]);
            }
        }
        System.out.println(result);
    }
}
0