小知识:
可使用atof(str)把字符串转换为一个double类型的浮点数。atof定义在math.h中。
此题可使用函数递归调用的方法求解。
#include<iostream>
#include<cmath>
using namespace std;
double exp() //读入逆波兰表达式,并计算其值
{
char s[10];//读入逆波兰表达式
小知识:
可使用atof(str)把字符串转换为一个double类型的浮点数。atof定义在math.h中。
此题可使用函数递归调用的方法求解。
#include<iostream>
#include<cmath>
using namespace std;
double exp() //读入逆波兰表达式,并计算其值
{
char s[10];//读入逆波兰表达式