求大佬指教,点一个点a了,然后后面是re。

P1449 后缀表达式

Yamoll @ 2018-06-02 17:37:05

include<bits/stdc++.h>

using namespace std; stack<int> a; string s; void panduan(int i){ int qian,hou; if(s[i]=='@'||s[i]=='.'); if(s[i]-'0'<=9&&s[i]-'0'>=0)a.push(s[i]-'0'); if(s[i]=='+'){hou=a.top();a.pop();qian=a.top();a.pop();a.push(qian+hou);} if(s[i]=='-'){hou=a.top();a.pop();qian=a.top();a.pop();a.push(qian-hou);} if(s[i]==''){hou=a.top();a.pop();qian=a.top();a.pop();a.push(qianhou);} if(s[i]=='/'){hou=a.top();a.pop();qian=a.top();a.pop();a.push(qian/hou);} } int main(){ cin>>s; int l,ans; l=s.length(); for(int i=0;i<l;i++){ panduan(i); } ans=a.top(); cout<<ans; return 0; }


by 密期望 @ 2018-06-02 18:47:13

```

(中间打代码)

```

#include<cstdio>

|