結果

問題 No.656 ゴルフ
ユーザー htensaihtensai
提出日時 2019-11-13 09:04:52
言語 Java19
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 2,369 ms
コンパイル使用メモリ 79,564 KB
実行使用メモリ 57,616 KB
最終ジャッジ日時 2023-10-21 19:38:12
合計ジャッジ時間 4,035 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
57,176 KB
testcase_01 AC 126 ms
57,404 KB
testcase_02 AC 126 ms
57,412 KB
testcase_03 AC 126 ms
57,392 KB
testcase_04 AC 127 ms
57,460 KB
testcase_05 AC 125 ms
57,476 KB
testcase_06 AC 124 ms
57,616 KB
testcase_07 AC 126 ms
57,444 KB
testcase_08 AC 125 ms
57,388 KB
testcase_09 AC 126 ms
57,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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