expin.h

来自「数据结构中堆栈的具体应用」· C头文件 代码 · 共 53 行

H
53
字号
// ExpIn.h: interface for the ExpIn class.
// 输入表达式
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EXPIN_H__54C7C223_B097_422C_AAAE_9B59E04DC0F2__INCLUDED_)
#define AFX_EXPIN_H__54C7C223_B097_422C_AAAE_9B59E04DC0F2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iostream.h>
#include <stdio.h>
#include <string.h>

class ExpIn  
{
public:
	ExpIn();
	virtual ~ExpIn();
	char Exp[100];      //长度暂定100,存储输入表达式
	int length;
};

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

ExpIn::ExpIn()
{//构造函数
	cout<<"******************************************************************"<<endl;

	cout<<"Input the Expression:"<<endl;
	cout<<"(Add '#' before and after the expression!!!)"<<endl;
	
	length=strlen(gets(Exp));
	//cout<<"Input Expression is:  "<<Exp<<endl;

	//int i;
	//for(i=0;i<length;i++)
	//	cout<<"Exp["<<i<<"]="<<Exp[i]<<endl;
	//cout<<"The length of the Expression is:"<<length<<endl;


}

ExpIn::~ExpIn()
{//析构函数

}

#endif // !defined(AFX_EXPIN_H__54C7C223_B097_422C_AAAE_9B59E04DC0F2__INCLUDED_)

⌨️ 快捷键说明

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