結果

問題 No.656 ゴルフ
ユーザー tsunabittsunabit
提出日時 2018-07-22 16:29:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 3,135 ms
コンパイル使用メモリ 73,492 KB
実行使用メモリ 56,060 KB
最終ジャッジ日時 2023-08-27 00:53:38
合計ジャッジ時間 4,873 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,816 KB
testcase_01 AC 109 ms
55,348 KB
testcase_02 AC 108 ms
55,900 KB
testcase_03 AC 109 ms
55,796 KB
testcase_04 AC 111 ms
55,556 KB
testcase_05 AC 114 ms
55,792 KB
testcase_06 AC 110 ms
55,788 KB
testcase_07 AC 111 ms
55,680 KB
testcase_08 AC 110 ms
55,560 KB
testcase_09 AC 109 ms
56,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.Stream;
import java.time.*;
import java.time.format.*;

public class No656 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		String s = sc.next();
        int total = 0;
        for(int i = 0; i < 9; i++) {
            if(s.charAt(i) != '0') {
                total += Character.getNumericValue(s.charAt(i));
            }else {
                total += 10;
            }
        }
        System.out.println(total);
	}
}
0