b22bb5b7
1
/**//**********************************
2
题目:波兰式计算器
3
/* 以下是几个标准的表达式:
4
5 * 2 + -3
5
5 * (2 + -3)
6
5 + ((-4 * -5) + (((5 + (6 - 2)) * 7 + ((4 + 2) * (3 - 1))))
7
与之等价的波兰表达式为
8
+ * 5 2 -3
9
* 5 + 2 -3
10
+ 5 + * -4 -5 + * + 5 - 6 2 7 * + 4 2 - 3 1
11
12
Author:Linghucong
13
Date:2007-4-28
14
***********************************/
15
#include <math.h>
16
#include <stdio.h>
17
#include <string>
18
#include <iostream>
19
using namespace std;
20
21
void Polan(string test)
{
22
string ops[100];
23
int opNum = -1;
24
int i = 0;
25
while (i < test.length())
26

/**//**********************************2
题目:波兰式计算器3
/* 以下是几个标准的表达式:4
5 * 2 + -35
5 * (2 + -3)6
5 + ((-4 * -5) + (((5 + (6 - 2)) * 7 + ((4 + 2) * (3 - 1))))7
与之等价的波兰表达式为8
+ * 5 2 -39
* 5 + 2 -310
+ 5 + * -4 -5 + * + 5 - 6 2 7 * + 4 2 - 3 111

12
Author:Linghucong13
Date:2007-4-2814
***********************************/15
#include <math.h>16
#include <stdio.h>17
#include <string>18
#include <iostream>19
using namespace std;20

21

void Polan(string test)
{22
string ops[100];23
int opNum = -1;24
int i = 0;25
while (i < test.length())26

