結果

問題 No.656 ゴルフ
ユーザー yamax3232
提出日時 2018-03-14 10:56:33
言語 Java
(openjdk 23)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 3,269 ms
コンパイル使用メモリ 74,532 KB
実行使用メモリ 41,140 KB
最終ジャッジ日時 2024-11-26 11:18:38
合計ジャッジ時間 4,649 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		int sum=0;
		Scanner kb=new Scanner(System.in);
		String s=kb.nextLine();
		for(int i=0;i<s.length();i++){
			int c=Character.getNumericValue(s.charAt(i));
			if(c==0){
				sum+=10;		
			}else {
				sum+=c;		
			}

		}
		System.out.println(sum);

	}

}
0