結果
問題 | No.289 数字を全て足そう |
ユーザー |
|
提出日時 | 2017-04-14 04:53:35 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 280 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 27,520 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 13:20:17 |
合計ジャッジ時間 | 1,094 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <stdio.h> #include <stdlib.h> int main(void){ char str[10000] ; scanf("%s", str ); int i, total; total = 0; for(i=0;i<10000;i++){ if((str[i]>= '0') && (str[i]<= '9')){ total += str[i] - '0'; }else if(str[i] == '\0'){ break; } } printf("%d", total); }