結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
|
提出日時 | 2018-03-11 20:35:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 385 ms |
コンパイル使用メモリ | 55,600 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-15 00:25:19 |
合計ジャッジ時間 | 1,302 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> #include <string> #include <cstdio> #include <cstdlib> using namespace std; int main() { int sum = 0; string s; cin >> s; for (char ch : s) { if(ch >= '0' && ch <= '9'){ sum += ch - '0'; } } cout << sum << endl; return 0; }