結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
|
提出日時 | 2018-05-08 22:17:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 827 ms |
コンパイル使用メモリ | 55,000 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 02:32:51 |
合計ジャッジ時間 | 1,325 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> #include <string> using namespace std; int main(int argc, char const* argv[]) { string input_word; int total = 0; cin >> input_word; for (int i = 0; i < input_word.size(); i++) { if (isdigit(input_word[i])) { total += input_word[i] - '0'; } } cout << total << endl; return 0; }