結果

問題 No.289 数字を全て足そう
ユーザー kosakkun
提出日時 2017-05-09 17:27:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 639 bytes
コンパイル時間 864 ms
コンパイル使用メモリ 83,204 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 20:03:01
合計ジャッジ時間 1,711 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
typedef long long ll;

int main(){
    
    string s; cin >> s;
    
    int ans = 0;
    REP(i,s.size()) {
        if(s[i] >= '0' && s[i] <= '9') ans += (s[i] - '0');
    }
    
    cout << ans << endl;
    
    return 0;
}
0