main.cpp

来自「中缀表达求后缀表达式及其值」· C++ 代码 · 共 31 行

CPP
31
字号
#include"fun.h"
#include"tran.h"


#include<string.h>
void main()
{
	char exp[80];
	double resault;
	
	cout<<"<<<<<<<请输入中缀表达式>>>>>>>"<<endl
		<<"-------------^_^--------------"<<endl
		<<"  =>";
	cin>>exp;
	cout<<"--------------OK--------------"<<endl<<endl;
	if(*(exp+strlen(exp)-1)!='#')
		cout<<"输入错误!!!"<<endl;
	else
	{
		cout<<"*******该式后缀表达式为*******"<<endl
			<<"-------------^_^--------------"<<endl
			<<"  =>";

		resault=translate(exp);
		cout<<endl<<"------------result------------"<<endl;
		cout<<" 该式的结果=>"<<resault;
		cout<<endl<<"-----------competed-----------"<<endl;
	}
	cin>>exp;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?