結果
問題 | No.289 数字を全て足そう |
ユーザー |
![]() |
提出日時 | 2017-09-01 09:00:09 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 281 bytes |
コンパイル時間 | 484 ms |
コンパイル使用メモリ | 56,360 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 17:10:11 |
合計ジャッジ時間 | 1,414 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> #include <string> using namespace std; int main(void) { string str; cin >> str; int sum = 0; string::iterator it; for(it = str.begin(); it != str.end(); it++) { if('0' <= *it && *it <= '9') sum += *it - 48; } cout << sum << endl; return 0; }