結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー Nao
提出日時 2017-04-25 15:27:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 1,611 ms
コンパイル使用メモリ 54,228 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 20:06:35
合計ジャッジ時間 1,770 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
	string str;
	cin >> str;
	
	int count = 0;
	for(int i = 0; i < str.length(); i++){
		int num = str[i] - '0';
		count += num;
	}
	cout << count << endl;
	return 0;
}
0