文章
5
粉丝
492
获赞
1
访问
36.6k
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include <math.h>
using namespace std;
int is_number(char c)
{
return '0' <= c && '9' >= c;
}
int symbol_type(char c)
{
switch(c)
{
case '+':
case '-':return 0;
case '*':
case '/':return 1;
case '^':return 2;
}
}
int is_symbol(char c)
{
return (c == '+' || c == '-' || c == '*' || c =='/' || c == '^');
}
int cal(int n1,char op,int n2)
{
switch(op)
{
case '+':return n1+n2;
case '-':return n1-n2;
&nb...
登录后发布评论
暂无评论,来抢沙发