結果

問題 No.289 数字を全て足そう
ユーザー Bantako
提出日時 2017-08-21 23:25:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 217 bytes
コンパイル時間 1,440 ms
コンパイル使用メモリ 167,112 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 00:55:39
合計ジャッジ時間 2,244 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
int sum;
main(){
    string s;
    cin >> s;
    for(char c:s)if(c >= '1' && c <= '9')sum += c-'0';
    cout << sum;
}
0