結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
![]() |
提出日時 | 2023-06-23 09:09:33 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 248 bytes |
コンパイル時間 | 1,628 ms |
コンパイル使用メモリ | 29,184 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 14:25:14 |
合計ジャッジ時間 | 1,012 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <stdio.h> #include <ctype.h> #include <string.h> int main() { char s[10001]; memset(s,0,10001); scanf("%s",s); int sum = 0; for (int i = 0;i < strlen(s);i++) { if (isdigit(s[i])) { sum += s[i] - '0'; } } printf("%d\n",sum); }