好文档 - 专业文书写作范文服务资料分享网站

c++实现计算器毕业课程设计报告

天下 分享 时间: 加入收藏 我要投稿 点赞

} 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 #include using namespace std; template class LinkedStack; template class Node {

friend LinkedStack; private: };

template class LinkedStack {

public:

LinkedStack(){top=0;length=0;} ~LinkedStack(); bool isEmpty()const { }

bool isFull()const; T Top() const;

return top==0;

T data; Node *link;

LinkedStack&Add(const T& x); LinkedStack&Delete(T& x);

int getLength(){return length;}

private:

Node *top;

};

int length;

template

LinkedStack::~LinkedStack() { }

template

bool LinkedStack::isFull()const {

try {

Node *next; while(top) { }

next=top->link; delete top; top=next;

Node *p=new Node;

}

catch(bad_alloc& e) {

delete p; return false;

return true; }

template

T LinkedStack::Top()const {

}

}

if(isEmpty())

throw CString(\堆栈空异常!\

return top->data;

template

LinkedStack& LinkedStack::Add(const T& x) {

Node *p=new Node; }

template

LinkedStack& LinkedStack::Delete(T& x) {

if(isEmpty()) }

throw CString(\堆栈空异常!\p->data=x; p->link=top; top=p; length++; return *this;

x=top->data; Node *p=top; top=top->link; delete p; length--; return *this;

c++实现计算器毕业课程设计报告

}elsethrowCString(\括号中的表达式不合法\<
推荐度:
点击下载文档文档为doc格式
3y5wb76adl3fre38hic91cf865breu010n5
领取福利

微信扫码领取福利

微信扫码分享