結果

問題 No.656 ゴルフ
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-03-02 22:22:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 2,006 ms
コンパイル使用メモリ 72,372 KB
実行使用メモリ 56,132 KB
最終ジャッジ日時 2023-09-03 22:23:35
合計ジャッジ時間 4,018 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,624 KB
testcase_01 AC 115 ms
55,592 KB
testcase_02 AC 113 ms
55,576 KB
testcase_03 AC 115 ms
56,132 KB
testcase_04 AC 116 ms
55,532 KB
testcase_05 AC 120 ms
55,596 KB
testcase_06 AC 119 ms
55,600 KB
testcase_07 AC 120 ms
55,548 KB
testcase_08 AC 120 ms
55,764 KB
testcase_09 AC 115 ms
55,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.System.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		String s = sc.next();
		int total = 0;
		int temp;
		for (int i=0; i<s.length(); i++) {
			temp = Character.getNumericValue(s.charAt(i));
			if (temp==0) {total += 10;}
			else {total += temp;}
		}
		out.println(total);
	}
}
0