結果

問題 No.656 ゴルフ
ユーザー bell
提出日時 2021-03-29 22:01:49
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 2,475 ms
コンパイル使用メモリ 74,236 KB
実行使用メモリ 41,228 KB
最終ジャッジ日時 2024-11-29 15:36:06
合計ジャッジ時間 4,425 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
    String [] s = sc.next().split("");
    int ans = 0;
    for (int i = 0; i < s.length; i++) {
      if (Integer.parseInt(s[i]) == 0) {
        ans += 10;
      } else {
        ans += Integer.parseInt(s[i]);
      }
    }
    System.out.println(ans);
    sc.close();
    }
  }
0