5 条题解

  • 0
    @ 2024-7-25 12:02:40

    #include<bits/stdc++.h> using namespace std; stackn; int s=0,x,y; int main(){ char ch; while((ch=getchar())!='@'){ if(ch>='0'&&ch<='9'){ s=s10+ch-'0'; }else if(ch=='.'){ n.push(s),s=0; }else{ x=n.top(); n.pop(); y=n.top(); n.pop(); switch(ch){ case '+':n.push(x+y);break; case '-':n.push(y-x);break; case '':n.push(x*y);break; case '/':n.push(y/x);break; } } } cout<<n.top(); return 0; }

    信息

    ID
    2053
    时间
    1000ms
    内存
    125MiB
    难度
    5
    标签
    递交数
    233
    已通过
    83
    上传者