1 条题解

  • 0
    @ 2025-10-8 17:01:01
    #include<bits/stdc++.h>
    using namespace std;
     
    int sta[110000],tp;
    int main()
    {
        int x=0,ans=0;
        tp=0;
    	char c;
        while(c=getchar())
        {
            if(c=='@') break;
            if(c<='9' && c>='0') 
            {
                x=x*10+c-48;
            }
            else if(c=='.')
            {
                sta[++tp]=x;
                x=0;
            }
            else
            {
                if(c=='+') sta[tp-1]+=sta[tp];
                if(c=='-') sta[tp-1]-=sta[tp];
                if(c=='*') sta[tp-1]*=sta[tp];
                if(c=='/') sta[tp-1]/=sta[tp];
                tp--;
                x=0;
            }
        }
        printf("%d\n",sta[1]);
        return 0;
    }
    • 1

    信息

    ID
    2366
    时间
    1000ms
    内存
    128MiB
    难度
    5
    标签
    递交数
    71
    已通过
    26
    上传者