結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
|
提出日時 | 2019-03-06 15:02:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 1,592 ms |
コンパイル使用メモリ | 168,060 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 14:35:01 |
合計ジャッジ時間 | 2,513 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n, s) for(int (i) = 0; (i) < (n); (i) += (s)) using namespace std; int main() { string str; cin >> str; int result = 0; for (int i = 0; i < str.length(); ++i) { if('0' <= str[i] && str[i] <= '9') { result += str[i] - '0'; } } cout << result << endl; }