結果

問題 No.289 数字を全て足そう
ユーザー wightou
提出日時 2025-04-29 01:03:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 545 bytes
コンパイル時間 3,776 ms
コンパイル使用メモリ 273,400 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-04-29 01:03:43
合計ジャッジ時間 4,366 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

/////////////////// メイン ///////////////////

int main () {
  
  //////////////////// 入力 ////////////////////

  string s;
  cin >> s;

  //////////////// 出力変数定義 ////////////////

  int result = 0;

  //////////////////// 処理 ////////////////////

  for (char c : s) {
    if ('0'<=c&&c<='9') {
      result += c-'0';
    }
  }

  //////////////////// 出力 ////////////////////

  cout << result << endl;

  //////////////////// 終了 ////////////////////

  return 0;

}
0