結果

問題 No.289 数字を全て足そう
ユーザー chuka231
提出日時 2015-10-16 22:26:27
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 54,876 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-21 18:50:09
合計ジャッジ時間 1,237 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <cstring>
using namespace std;

int main()
{
	char str[1111];
	int ans = 0;

	cin >> str;

	for (int i = 0; i < strlen(str); i++) {
		if (str[i] >= '0' && str[i] <= '9') ans += str[i]-'0';
	}

	cout << ans << endl;

	
	return 0;
}
0