expression.cpp

来自「一个C++对赋值语句的翻译,能输出四元式」· C++ 代码 · 共 28 行

CPP
28
字号
// Expression.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "ExpressionCompli.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
	char Strexp[1000];
	double ans;
	cout<<"Please Input Expression:"<<endl;
	cin>>Strexp;
	CExpression exp;

	exp.SetExpression((pExpression)Strexp);
	ans=0;
	
	if (exp.Compile()==ERROR_NULL && exp.Solve(ans)==ERROR_NULL){
		cout<<"Answer:"<< ans;
	}else{
		cout<<"Error!"<<endl;
	}
    getchar();
    getchar();
	return 0;
}

⌨️ 快捷键说明

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