acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

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

    userId_undefined

    复仇者_纳西妲厨一位

    时空双修者题解仙人秩序白银
    37阅读
    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

    幼儿园高材生

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

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

    userId_undefined

    entj

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

提交答案之后,这里将显示提交结果~

首页