无输出求助
查看原帖
无输出求助
1059639
_is_laofang_楼主2024/9/30 18:03

rt\frac{r}{t},不是ctj,老师上课就这么讲的

#include<bits/stdc++.h>
using namespace std;
int main(){
	char c;
	stack<int>s;
	int x,y;
	cin>>x;
	x%=10000;
	s.push(x);
	while(cin>>c>>y){
		if(c=='*'){
			int t=s.top();
			s.pop();
			s.push(t*y%10000);
		}else s.push(y);
	}
	int ans=0;
	while(s.size()){
		ans+=s.top();
		ans%=10000;
		s.pop();
	}
	cout<<ans;
	return 0;
}
2024/9/30 18:03
加载中...