結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー NONODOKA
提出日時 2023-01-06 13:31:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 716 bytes
コンパイル時間 6,227 ms
コンパイル使用メモリ 244,268 KB
最終ジャッジ日時 2025-02-09 23:27:56
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#if !__INCLUDE_LEVEL__
#include __FILE__
using namespace std;

int main()
{
    string s;
    cin >> s;
    int ans=0;

    for(char c : s){
        ans += int(c-'0');
    }
    cout << ans << endl;
}

#else
#include <bits/stdc++.h>
#include <boost/format.hpp>
#include <boost/range/algorithm.hpp>
#define REP_(i, a_, b_, a, b, ...) for (int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(v) (v).begin(),(v).end()
template <class T> bool chmin(T &a, const T &b) { return a > b ? a = b, true : false; }
template <class T> bool chmax(T &a, const T &b) { return a < b ? a = b, true : false; }
template <class T> using V = std::vector<T>;
#endif
0