cn_lemon @ 2017-07-12 18:57:03
题目是什么意思,这个样例哪位大佬能解释一下
by WilliamPen @ 2017-07-12 19:23:06
膜拜大佬
by JKPS @ 2017-07-17 14:38:31
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<stack>
using namespace std;
char s[1010];
stack<int> st;
int main(){
char t='\0',ttt[200],pos=0;
int shu,t1,t2,tans;
while(t!='@')
{
t=getchar();
if(t>='0'&&t<='9')
{
ttt[pos++]=t;
continue;
}
else if(t=='.')
{
ttt[pos]='\0';pos=0;
sscanf(ttt,"%d",&shu);
st.push(shu);
continue;
}
else if(t!='@')
{
t1=st.top(); st.pop();
t2=st.top(); st.pop();
switch(t){
case '+':st.push(t2+t1);break;
case '-':st.push(t2-t1);break;
case '*':st.push(t2*t1);break;
case '/':st.push(t2/t1);break;
}
continue;
}
}
cout<<st.top();
return 0;
}
by JKPS @ 2017-07-17 14:41:32
拿出一本通,翻到数据结构的栈,自己看
by 觞羰涙 @ 2017-08-29 13:54:34
by 香风智乃 @ 2017-09-17 17:24:38
我也看不懂.......
by loheagn @ 2018-01-18 15:29:21
同看不懂题目……