freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

工大數(shù)據(jù)結(jié)構(gòu)第三章作業(yè)-資料下載頁

2025-06-26 23:29本頁面
  

【正文】 LL){ prints(rootleft)。 coutrootid。 prints(rootright)。 } else if(rootparentleft==rootamp。amp。Match(rootid[0],rootparentid[0])==39。39。){ prints(rootleft)。 coutrootid。 prints(rootright)。 } else if(rootparentright==root){ if(Match(rootparentid[0],rootid[0])==39。39。||rootparentid[0]==39。+39。){ prints(rootleft)。 coutrootid。 prints(rootright)。 } else{ cout(。 prints(rootleft)。 coutrootid。 prints(rootright)。 cout)。 } } else{ cout(。 prints(rootleft)。 coutrootid。 prints(rootright)。 cout)。 }}double solve(TNode *root){ if(rootleft==NULL){ istringstream in。 (rootid)。 double value。 invalue。 return value。 } else{ switch(rootid[0]){ case 39。+39。: return solve(rootleft)+solve(rootright)。 case 39。39。: return solve(rootleft)solve(rootright)。 case 39。*39。: return solve(rootleft)*solve(rootright)。 case 39。/39。: return solve(rootleft)/solve(rootright)。 } }}void Check(char *str) //判斷為帶符號(hào)且緊跟括號(hào)的情況,酌情在前面添0{ int k=0,i=0。 if(str[0]==39。+39。||str[0]==39。39。){ int b=0。 while(str[k]==39。+39。||str[k]==39。39。){ if(str[k]==39。39。) b++。 k++。 } if(str[k]!=39。(39。) return。 char *np=new char[strlen(str)+3]。 if(b%2){ np[0]=39。039。 np[1]=39。39。 memcpy(np+2,str+k,strlen(str)+1k)。 memcpy(str,np,strlen(np)+1)。 } else{ memcpy(np,str+k,strlen(str)+1k)。 memcpy(str,np,strlen(np)+1)。 } delete[] np。 }} void main(){ char buf[100]。 while(1){ cinbuf。 Check(buf)。 printExpr(buf)。 }}//stack類includeiostreamincludestringusing namespace std。//class stacktemplate typename Tclass SNode{ public: SNode(){next=NULL。} SNode(const Tamp。 td,SNodeT* p=NULL){data=td。 next=p。} T data。 SNodeT *next。}。template typename Tclass Stack{ public: Stack(){pdata=NULL。length=0。} ~Stack()。 bool isEmpty()。 bool pop()。 bool push(const Tamp。 )。 T top()。 int size(){ return length。} private: SNodeT *pdata。 int length。}。template typename TStackT::~StackT(){ SNodeT *sp=pdata,*np。 while(sp) { np=spnext。 delete sp。 sp=np。 }}template typename Tbool StackT::isEmpty(){ return pdata==NULL。}template typename Tbool StackT::pop(){ SNodeT *sp=pdata。 if(!sp) return false。 length。 if(!spnext){ delete sp。 pdata=NULL。 return true。 } else{ while((spnext)next) sp=spnext。 delete spnext。 spnext=NULL。 return true。 }}template typename Tbool StackT::push(const Tamp。 st){ SNodeT *np=new SNodeT(st),*sp=pdata。 if(!np) return false。 length++。 if(!sp){ pdata=np。 return true。 } else{ while(spnext) sp=spnext。 spnext=np。 return true。 }}template typename TT StackT::top(){ SNodeT *sp=pdata。 if(!sp) return T()。 while(spnext) sp=spnext。 return spdata。}要求:上述作業(yè)要求在單獨(dú)完成;完成后,于規(guī)定期限內(nèi)提交到ftp服務(wù)器的相應(yīng)目錄中中,注意,在提交時(shí)將所編寫的程序統(tǒng)一拷貝到一個(gè)Word文件中,文件名格式為“學(xué)號(hào)+姓名
點(diǎn)擊復(fù)制文檔內(nèi)容
職業(yè)教育相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1