結果

問題 No.656 ゴルフ
ユーザー GBGB
提出日時 2018-04-23 12:29:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 2,221 ms
コンパイル使用メモリ 71,904 KB
実行使用メモリ 49,752 KB
最終ジャッジ日時 2023-09-09 21:34:39
合計ジャッジ時間 3,257 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,284 KB
testcase_01 AC 43 ms
49,364 KB
testcase_02 AC 42 ms
47,308 KB
testcase_03 AC 43 ms
49,752 KB
testcase_04 AC 43 ms
49,648 KB
testcase_05 AC 43 ms
49,128 KB
testcase_06 AC 43 ms
49,608 KB
testcase_07 AC 43 ms
49,208 KB
testcase_08 AC 43 ms
49,340 KB
testcase_09 AC 43 ms
49,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    String n=br.readLine();

    int sum=0;
    for(int i=0;i<n.length();i++){
      int x=Character.getNumericValue(n.charAt(i));
      if(x==0){
        sum+=10;
      }
      sum+=x;
    }

    System.out.println(sum);
  }
  }
0