結果

問題 No.656 ゴルフ
ユーザー shinwisteria
提出日時 2018-03-04 10:18:29
言語 Java
(openjdk 23)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 3,665 ms
コンパイル使用メモリ 79,024 KB
実行使用メモリ 41,624 KB
最終ジャッジ日時 2024-07-06 15:23:35
合計ジャッジ時間 5,661 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con656 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String score = s.next();
		s.close();

		int count = 0;
		for(int i = 0;i < 9;i++){
			int k = Integer.parseInt(score.substring(i, i+1));
			if(k == 0){
				count += 10;
			}else{
				count += k;
			}
		}
		System.out.println(count);

	}

}
0