結果
| 問題 | No.289 数字を全て足そう | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-08-27 23:11:47 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 1,000 ms | 
| コード長 | 271 bytes | 
| コンパイル時間 | 608 ms | 
| コンパイル使用メモリ | 64,904 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-06 07:03:40 | 
| 合計ジャッジ時間 | 1,447 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
#include <iostream>
#include <string>
using namespace std;
inline int decode(char c)
{
if(c >= '0' and c <= '9'){
return c-'0';
} else {
return 0;
}
}
int main()
{
string s;
cin >> s;
int num = 0;
for(const char c:s){
num += decode(c);
}
cout << num << endl;
return 0;
}
            
            
            
        