結果

問題 No.289 数字を全て足そう
ユーザー koyumeishi
提出日時 2015-10-17 06:06:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 348 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 73,548 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-07 20:20:51
合計ジャッジ時間 1,575 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
	string s;
	cin >> s;
	int ans = 0;
	for(auto c:s){
		if('0' <= c && c<='9'){
			ans += c-'0';
		}
	}
	cout << ans << endl;
	return 0;
}
0