結果

問題 No.289 数字を全て足そう
ユーザー Maeda
提出日時 2025-03-03 14:36:34
言語 C
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 366 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 25,216 KB
実行使用メモリ 15,172 KB
最終ジャッジ日時 2025-03-03 14:36:39
合計ジャッジ時間 4,764 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample TLE * 1 -- * 2
other -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

void main(void){
	char str[100000];
    int inputStr =scanf("%s\n",str);
    if(inputStr == 2){
    	printf("文字列の入力ミス\n");
    }
	int sum = 0 , i = 0 ;
	while(str[i] != '\0'){
		int charNum = str[i] - '0';
		if(charNum >= 0 && charNum <= 9){
			sum += charNum;
		}	
	}
	printf("%d\n",sum);
}
0