結果
| 問題 | No.289 数字を全て足そう |
| コンテスト | |
| ユーザー |
OR6107
|
| 提出日時 | 2020-11-02 17:45:34 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 291 bytes |
| 記録 | |
| コンパイル時間 | 1,613 ms |
| コンパイル使用メモリ | 186,156 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-04-03 07:49:57 |
| 合計ジャッジ時間 | 3,480 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 0;
for (int i = 0; i < s.size(); i++) {
if ('0' <= s.at(i) && s.at(i) <= '9') {
ans += int(s.at(i) - '0');
}
}
cout << ans << endl;
return 0;
}
OR6107