結果

問題 No.289 数字を全て足そう
ユーザー iodo_shiba
提出日時 2018-08-30 08:06:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 283 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 57,916 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-13 19:48:23
合計ジャッジ時間 1,163 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<sstream>
#include<string>
#include<ctype.h>

int main(){
    std::string in;
    std::cin >> in;
    int sum=0;
    for(char c:in){
        if(isdigit(c)){
            int t = c-'0';
            sum+=t;
        }
    }
    std::cout << sum << std::endl;
}
0