結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
![]() |
提出日時 | 2017-03-01 21:18:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 612 ms |
コンパイル使用メモリ | 55,400 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 22:44:40 |
合計ジャッジ時間 | 1,731 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> #include <string> #define REP(i,n) for(int i=0;i<(n);++i) #define SORT(a) sort((a).begin(),(a).end()) #define PB push_back using namespace std; int main(){ string S; cin >> S; int l = S.size(); int r = 0; REP(i,l){ char c = S[i]; if(c >= '0' && c <= '9'){ r += c - '0'; } } cout << r << endl; }