【正文】
ber as the maxsize of the roomStack:endl。 cinN。//這里 N將作為棧能存放元素的數(shù)量 while(N=0) { coutOh!You have enter a wrong number,39。N39。 should above enter another number again:endl。 cinN。 } //stack *max。 //maxsize=maxsize。 char ch1。 stack* s1,*s2。 queue* q。 cinfo x。 int flag。 s1=new stack。 s2=new stack。 q=new queue。 initstack(s1)。 initstack(s2)。 initqueue(q)。 flag=1。 for(。) {coutPlease enter the infomation: 39。A39。/39。D39。 car number。 car arrival time.endl。 cinch1。 switch(ch1) { case39。A39。: case39。a39。:carrival(s1,q,x)。 break。 case39。D39。: case39。d39。:carleave(s1,s2,q,x)。 break。 case39。E39。: case39。e39。:flag=0。coutOk,the system will be shut down!Written by ZIGZ!endl。 break。 default:coutYou have enter a wrong!!endl。 } if(flag==0) break。 } } 七、運行結(jié)果: 八、經(jīng)驗小結(jié): 通過《停車場管理》的實驗學(xué)習(xí)使我基本上理解并學(xué)會了用棧 的先進后出 和隊列 的先進先出的原理 去解決實際問題的思想和方法。但是在編程方面還是很欠缺 ,還要加強學(xué)習(xí)。