//using System;
class Class1
{
public static void Main()
{
System.Console.WriteLine("Hello World!");
//中缀 => 后缀表达式
string s = "( 1.9 +(20 +41)/ (25*11) -3 ) * 2"; //中缀; //中缀
string S = ""; //后缀
char[] Operators = new char[s.Length];
int Top = -1;
for (int i = 0; i < s.Length; i++)
{
char C = s[i];
switch (C)
{
case ' ': //忽略空格
break;
case '+': //操作符
case '-':
while (Top >= 0) //栈不为空时
{
char c = Operators[Top--]; //pop Operator
if (c == '(')
{
<
用C#计算算式结果
最新推荐文章于 2023-03-14 20:20:04 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)