作业帮 > 综合 > 作业

哪位高手帮忙用C++做一个求复杂表达式的计算器~

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/06/08 12:01:36
哪位高手帮忙用C++做一个求复杂表达式的计算器~
RT,要满足下列要求,不胜感激啊~
(1) 数值:包括整数和实数,数值可带正、负号.
(2) 一般运算符:正号、负号、加、减、乘、除、求模和乘方,其中可以包括括号.
(3) 单词(即运算函数):abs、sqrt、exp、ln、log10、sin、cos和tanh.
例如:输入一个表达式: 2*sqrt(16)-(-3+5)*(-5),得到运算结果18
#include "iostream"
#include "math.h"
#include "cstring"
using namespace std;
const int MaxSize=300;
int trans(char *exp,char postexp[]);
double compvalue(char *postexp);
int main(int argc,char* argv[])
{
char exp[300],postexp[400];
cout