結果

問題 No.656 ゴルフ
ユーザー YamaKasa
提出日時 2018-05-09 17:42:57
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 1,971 ms
コンパイル使用メモリ 74,724 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-06-28 02:49:07
合計ジャッジ時間 3,843 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();
		int cnt = 0;
		for(int i = 0; i < 9; i++) {
			int k = Integer.parseInt(s.substring(i, i + 1));
			if(k == 0) {
				cnt += 10;
			}else {
				cnt += k;
			}
		}
		System.out.println(cnt);
	}
}
0