結果

問題 No.289 数字を全て足そう
ユーザー chiyoda
提出日時 2016-06-23 18:05:31
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 2,239 ms
コンパイル使用メモリ 74,928 KB
実行使用メモリ 56,956 KB
最終ジャッジ日時 2024-10-11 18:39:43
合計ジャッジ時間 7,118 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int res = 0;
    for  (int i = 0; i  < s.length(); i++) {
      try {
          res += Integer.valueOf(s.indexOf(i));
      } catch (NumberFormatException e) {    
      }
    }
    System.out.println(res);
  }
}
0