} else
throw CString(\括号中的表达式不合法\
} try { }
catch(CString e) { }
double data1,data2;
throw CString(\出现未匹配的)\op.Delete(mid); } else
throw CString(\出现未匹配的)\
try
{
data.Delete(data2);
data.Delete(data1);
}
catch(CString e) { }
throw CString(\缺少操作数\
if(!jisuan(data1,data2,mid,data1))
{
result=0;
throw CString(\表达式异常\}
data.Add(data1);
}
pre=(int)op.Top();
CompuetrDlg.cpp : 实现文件
#include \ }
Compuetr.cpp : 定义应用程序的类行为。
#include \} stack
#include
} else { }
int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) 2; int y = (rect.Height() - cyIcon + 1) 2; 绘制图标
dc.DrawIcon(x, y, m_);
CRect rect;
CPaintDC dc(this); GetClientRect(rect);
dc.FillSolidRect(rect,RGB());设置背景颜色 CDialog::OnPaint();
CDialog::OnPaint();
#include
friend LinkedStack
template
public:
LinkedStack(){top=0;length=0;} ~LinkedStack(); bool isEmpty()const { }
bool isFull()const; T Top() const;
return top==0;
T data; Node
LinkedStack
int getLength(){return length;}
private:
Node
};
int length;
template
LinkedStack
template
bool LinkedStack
try {
Node
next=top->link; delete top; top=next;
Node
}
catch(bad_alloc& e) {
delete p; return false;
return true; }
template
T LinkedStack
}
}
if(isEmpty())
throw CString(\堆栈空异常!\
return top->data;
template
LinkedStack
Node
template
LinkedStack
if(isEmpty()) }
throw CString(\堆栈空异常!\p->data=x; p->link=top; top=p; length++; return *this;
x=top->data; Node