結果

問題 No.289 数字を全て足そう
ユーザー ああああああああ
提出日時 2019-09-05 17:42:24
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 276 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 28,544 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-11 20:55:30
合計ジャッジ時間 916 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int total(char str[])
{
	int i;
	int total=0;
	
	for(i=0;str[i]!=0;i++){
		if(str[i]>='0'&&str[i]<='9'){
			total+=str[i]-48;
		}
	}
	
	return total;
}

int main(void)
{
	
	char str[10001]={};
	
	scanf("%s",str);
	
	printf("%d\n",total(str));

	return 0;
}
0