結果

問題 No.289 数字を全て足そう
ユーザー kazapyon27
提出日時 2017-05-05 11:08:48
言語 Java
(openjdk 23)
結果
AC  
実行時間 90 ms / 1,000 ms
コード長 535 bytes
コンパイル時間 3,470 ms
コンパイル使用メモリ 74,068 KB
実行使用メモリ 38,520 KB
最終ジャッジ日時 2024-09-14 08:37:03
合計ジャッジ時間 5,681 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.289 数字を全て足そう*/
import java.io.*;
public class No289 {
	public static void main(String[] args) {
		String r_moji,moji;
		int result=0;
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			r_moji=input.readLine();
			for(short i=0;i<r_moji.length();i++){
				moji=r_moji.substring(i, i+1);
				if(moji.codePointAt(0)>=48 &&moji.codePointAt(0)<=57){
					result+=Integer.parseInt(moji);
				}
			}
			System.out.println(result);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0