結果

問題 No.289 数字を全て足そう
ユーザー mell1
提出日時 2018-11-22 15:44:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 407 bytes
コンパイル時間 487 ms
コンパイル使用メモリ 54,904 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-24 17:39:21
合計ジャッジ時間 1,449 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#define N 10000
using namespace std;
int main() {
    int i, s = 0;
    char a;
    for (i=0; i<N; i++) {
        a = getchar();
        if (a >= 48 && a <= 57) {
            s += a - 48;
        } else if ((a >= 65 && a <= 90) || (a >=  97 && a <= 122)) {
            continue;
        } else {
            break;
        }
    }
    cout << s << endl;
    return 0;
}
0