結果
問題 | No.289 数字を全て足そう |
ユーザー |
![]() |
提出日時 | 2018-09-16 22:06:01 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 272 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 28,544 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 07:31:58 |
合計ジャッジ時間 | 785 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <stdio.h> int main() { char str[100001]; int i; int sum=0; scanf("%s",str); for(i=0;str[i]!='\0';i++){ if(str[i]>='0'&&str[i]<='9'){ sum+=(int)(str[i]-'0'); } } printf("%d\n",sum); return 0; }