結果

問題 No.49 算数の宿題
ユーザー fura
提出日時 2020-04-14 03:40:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 2,566 ms
コンパイル使用メモリ 192,172 KB
最終ジャッジ日時 2025-01-09 18:22:30
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	string s; cin>>s;
	stringstream ss(s);
	int ans=0;
	char op='*';
	while(!ss.eof()){
		int a; ss>>a;
		if(op=='*') ans+=a;
		else        ans*=a;
		ss>>op;
	}
	cout<<ans<<'\n';
	return 0;
}
0