提交后得100分的C++程序如下:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
while(n--){
string str;
cin>>str;
stack<int> tmp;//运算数
stack<char> op;//运算符
for(int i=0;i<7;i++)
{
if(str[i]>='1'&&str[i]<='9')
{
tmp.push(str[i]-'0');
}
else if(str[i]=='+'||str[i]=='-')
{
while(!op.empty()){