結果

問題 No.49 算数の宿題
ユーザー togari_takamoto
提出日時 2016-02-28 12:44:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 272 bytes
コンパイル時間 1,294 ms
コンパイル使用メモリ 159,772 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 01:48:49
合計ジャッジ時間 1,820 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	string s; cin >> s;
	char* i;
	int sum = strtol(s.c_str(), &i, 10);
	while (*i!='\0') {
		sum = *i == '*' ? sum + strtol(i + 1, &i, 10)
		                : sum * strtol(i + 1, &i, 10);
	}
	cout << sum << endl;
}
0