結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
|
提出日時 | 2019-12-15 02:13:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 33 ms / 1,000 ms |
コード長 | 286 bytes |
コンパイル時間 | 751 ms |
コンパイル使用メモリ | 73,620 KB |
最終ジャッジ日時 | 2025-01-08 11:37:22 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int sum=0; for(char c:s){ if('0'<=c&&c<='9'){ sum+=(c-'0'); } } cout << sum << endl; }