結果

問題 No.656 ゴルフ
ユーザー Pump0129Pump0129
提出日時 2018-03-26 11:15:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 3,349 ms
コンパイル使用メモリ 71,612 KB
実行使用メモリ 56,256 KB
最終ジャッジ日時 2023-09-07 12:37:13
合計ジャッジ時間 3,957 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,432 KB
testcase_01 AC 116 ms
55,720 KB
testcase_02 AC 113 ms
55,916 KB
testcase_03 AC 123 ms
55,644 KB
testcase_04 AC 126 ms
55,960 KB
testcase_05 AC 114 ms
55,704 KB
testcase_06 AC 114 ms
55,644 KB
testcase_07 AC 114 ms
56,256 KB
testcase_08 AC 117 ms
55,992 KB
testcase_09 AC 124 ms
55,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package net.ipipip0129.yukicoder.no656;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String line = scan.nextLine();
		
		scan.close();
		
		int score = 0;
		
		for (int i = 0; i < line.length(); i++) {
			int point = Integer.parseInt(line.substring(i, i + 1));
			if (point == 0) {
				score += 10;
			}else {
				score += point;
			}
		}
		
		System.out.println(score);
	}
}
0