結果

問題 No.289 数字を全て足そう
ユーザー gedy01221406
提出日時 2019-10-09 23:05:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 339 bytes
コンパイル時間 1,103 ms
コンパイル使用メモリ 66,224 KB
最終ジャッジ日時 2025-01-07 21:23:30
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
//#include <numeric>
//#include <vector>
//#include <cstdint>
#include <string>
#include <cstdlib>
using namespace std;

int main() {
	//char* array;
	//cin >> array;

	string s;
	cin >> s;

	int n = 0;

	for (int i = 0; i < s.length(); i++) {
		string a{ s[i] };
		n += atoi(a.c_str());
	}

	cout << n;


	return 0;

}
0