結果

問題 No.289 数字を全て足そう
ユーザー genusn
提出日時 2018-12-07 05:07:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 279 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 56,008 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-14 03:13:14
合計ジャッジ時間 1,349 ms
ジャッジサーバーID
(参考情報)
judge6 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main()
{
	string strA = "";
	cin >> strA;
	int iSum = 0;
	for (int iI = 0; iI < strA.size(); ++iI) {
		char c = strA.at(iI);
		if (c >= '0' && c<= '9') {
			iSum += (c-'0');
		}
	}
	cout << iSum << endl;
	return 0;
}
0