結果

問題 No.289 数字を全て足そう
ユーザー githide3
提出日時 2018-07-21 15:21:48
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 302 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 28,928 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 04:51:05
合計ジャッジ時間 1,263 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include    <stdio.h>
#include    <ctype.h>

int main(void)
{
    int     sum = 0;
    char    c;

    while ((c = getchar()) != EOF) {
        if (c == '\n') {
            break;
        } else if (isdigit(c)) {
            sum += (c - 0x30);
        }
    }
    printf("%d\n", sum);

    return 0;
}
0