acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 用STL容器就能做了

    userId_undefined

    复仇者_纳西妲厨一位

    题解仙人时空双修者秩序白银集训营话痨
    26阅读
    0回复
    1点赞
  • 答案

    #include<bits/stdc++.h> using namespace std; int main(){ stack<int> s; string a; cin >> a; int len = a.size(); for(int i=0;i<len;i++ ) { if(a[i]>='0' and a[i]<='9'){ int sum=0; while(a[i]!='.'){ sum=sum10+(a[i]-'0'); i++; } s.push(sum); } if(a[i]'+' || a[i]'-' || a[i]=='' || a[i]'/' ){ int x1=0,x2=0; x1=s.top(); s.pop(); x2=s.top(); s.pop(); if(a[i]'+'){ s.push(x2+x1); } if(a[i]'-'){ s.push(x2-x1); } if(a[i]''){ s.push(x2x1); } if(a[i]=='/'){ s.push(x2/x1); } } } cout<<s.top(); return 0; }

    userId_undefined

    幼儿园高材生

    16阅读
    0回复
    0点赞
  • STL容器是必要的

    直接上题解好吧! 不懂私信我

    userId_undefined

    entj

    出道萌新时空双修者字符串·魔法使贪心·贪心尝试者秩序白银快乐小狗
    3阅读
    0回复
    0点赞
首页