結果
| 問題 | No.289 数字を全て足そう |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-15 12:34:32 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 331 ms |
| コンパイル使用メモリ | 75,308 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-17 18:47:59 |
| 合計ジャッジ時間 | 1,220 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <iostream>
#include <cctype>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define print(x) cout << x << endl;
using namespace std;
int main(void){
cin.tie(0);
ios::sync_with_stdio(false);
string str;
cin >> str;
int ans = 0;
string c;
REP(i, str.size()){
if (isalpha(str[i])){
continue;
}else{
c = str.substr(i,1);
ans += stoi(c);
}
}
print(ans);
return 0;
}