資源簡介
該軟件有c++語言編寫,實現了對數學公式計算。<br>如(45+78)*45-9 等,沒有涉及異常處理
代碼片段和文件信息
#include
#include
#include“exam-4h.h“
using?namespace?std;
Calculation::Calculation(const?string&?exp)
{
expression=exp;
length=exp.length();
turnToTag();
firstExpPtr=NULL;
lastExpPtr=NULL;
}
Calculation::~Calculation()
{
delete?[]tag;
if(firstExpPtr!=NULL)
{
while(firstExpPtr->next!=NULL)
{
????NODE*?temptr;
????temptr=firstExpPtr;
????firstExpPtr=firstExpPtr->next;
????delete?temptr;
}
}
delete?firstExpPtr;
lastExpPtr=NULL;
delete?lastExpPtr;
}
bool?Calculation::examexpression()?????????????//表達式是否合法;
{
int?i=0;
if(!examBraches()?||?!examDot())???????????????//當小數點位置合法且括號不匹配時
return?false;
while(i {
?if(!nextWord(i))??????????????????????????//當當前字符與其后的字符不匹配時
?break;?????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????15427??2007-10-08?16:23??計算數學公式\exam-4.cpp
?????文件???????2169??2007-10-08?16:23??計算數學公式\exam-4h.h
?????文件????????289??2007-10-08?16:23??計算數學公式\testExam-4.cpp
?????目錄??????????0??2007-12-16?19:44??計算數學公式
-----------?---------??----------?-----??----
????????????????17885????????????????????4
- 上一篇:快遞查詢c++代碼
- 下一篇:C++調用百度地圖API
評論
共有 條評論