結果

問題 No.289 数字を全て足そう
ユーザー K_Meraq6
提出日時 2020-11-02 18:05:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 254 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 64,256 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 06:26:23
合計ジャッジ時間 1,301 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
    string s; cin >> s;
    int c = 0;
    for (int i = 0; i < s.size(); ++i) {
        if ('1' <= s.at(i) && s.at(i) <= '9') {
            c += s.at(i) - '0';
        }
    }
    cout << c << endl;
}
0