10分求调!!!
查看原帖
10分求调!!!
1276415
abababwosb楼主2024/8/27 21:56
#include <bits/stdc++.h>
using namespace std;

int main() {
//	freopen("a.in", "r", stdin);
//	freopen("a.out", "w", stdout);
	stack<int> s;
	int a, tmp = 0;
	char b;
	cin >> a;
	s.push(a);
	while (cin >> b >> a) {
		a %= 100000;
		if (b == '+') {
			s.push(a);
		} else if (b == '*') {
			tmp = s.top();
			s.pop();
			s.push(tmp * a);
		}
	}
	while (s.size() > 0) {
		tmp += s.top();
		s.pop();
	}
	tmp %= 10000;
	cout << tmp;
	return 0;
}

6、7行别看,调试用的

2024/8/27 21:56
加载中...