#include <iostream>
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
class antomobile{
public:
double money;//车费
int number;//车牌
int year;//使用年限
int time;//停车时间
int p=0;//停车状态
//int weight=0;//重量
//int people=0;//载客
//int gas=0;//排气
virtual double pay()
{
return money;
}//虚函数pay方法
virtual ~antomobile(){};//析构函数
};
class truck:public antomobile{
public:
int weight;
truck()
{
number=0;
year=0;
time=0;
weight=0;
}
friend istream &operator>>(istream &input, truck &D )
{
cout<<"请输入卡车车牌"<<endl;
input >> D.number;
cout<<"请输入卡车年限"<<endl;
input>> D.year;
cout<<"请输入卡车载重"<<endl;
input>>D.weight;
cout<<"请输入卡车停车时间"<<endl;
input>>D.time;
return input;
}
double pay(){
money=2*time;
return money;
}
~truck(){};
};
class carriage:public antomobile{
public:
int people=0;
friend istream &operator>>( istream &input, carriage &D )
{
cout<<"请输入客车车牌"<<endl;
input >> D.number;
cout<<"请输入客车年限"<<endl;
input>> D.year;
cout<<"请输入客车载客"<<endl;
input>>D.people;
cout<<"请输入客车停车时间"<<endl;
input>>D.time;
return input;
}
carriage()
{
number=0;
year=0;
time=0;
people=0;
}
double pay(){
money=(1.5)*time;
return money;
}
~carriage(){};
};
class car:public antomobile{
public:
int gas=0;
friend istream &operator>>( istream &input, car &D )
{
cout<<"请输入小轿车车牌"<<endl;
input >> D.number;
cout<<"请输入小轿车年限"<<endl;
input>> D.year;
cout<<"请输入小轿车排气"<<endl;
input>>D.gas;
cout<<"请输入小轿车停车时间"<<endl;
input>>D.time;
return input;
}
car()
{
number=0;
year=0;
time=0;
gas=0;
}
double pay(){
money=1*time;
return money;
}
~car(){};
};
class park{
//卡车1轿车2小车3
public:
int a[3][2];
int sum;//总车数
int trucknum;//卡车数
int carriagenum;//轿车数
int carnum;//小车数
park(){
int a[3][2]={{0,0},{0,0},{0,0}};
int sum=0;
int trucknum=0;
int carriagenum=0;
int carnum=0;
}
void tingche(int n,int m)//n是车子类型1-3,m是车牌号
{
for(int i=0;i<3;++i)
{
if(a[i][0]==0){a[i][0]=n;a[i][1]=m;break;}
}
switch(n){
case 1:trucknum++;break;
case 2:carriagenum++;break;
case 3:carnum++;break;
}
sum++;
}
void chuku(int n)//n是车牌号
{
int s=0;
for(int i=0;i<3;++i)
{
if(a[i][1]==n)s=i;
}
switch(a[s][0]){
case 1:trucknum--;break;
case 2:carriagenum--;break;
case 3:carnum--;break;
}
a[s][0]=0;
a[s][1]=0;
sum--;
}
};
park p;
truck t[100];int q=0;
carriage carr[100];int w=0;
car car[100];int e=0;
void play0();//主页面
void play1();//停车页面
void play2();//开车页面
void play3();//统计页面
int main()
{ cout<<" 版权所有\\欢迎使用本系统/翻录必究 "<<endl;
play0();
return 0;
}
void play1(){
if(p.sum>=3){cout<<"没有多余的车位了"<<endl;play0();}
cout<<" a为卡车分配停车位"<<endl;
cout<<" b为客车分配停车位"<<endl;
cout<<" c为小较车分配停车位"<<endl;
cout<<"请选择:";
char n;
cin>>n;
switch(n){
case 'a':
cin>>t[q];t[q].p=1;p.tingche(1,t[q].number);++q;play0();
break;
case 'b':
cin>>carr[w];carr[w].p=1;p.tingche(2,carr[w].number);++w;play0();
break;
case 'c':
cin>>car[e];car[e].p=1;p.tingche(3,car[e].number);++e;play0();
break;
}
}
void play2(){
int n;
cout<<"请输入开走车辆的车牌"<<endl;
cin>>n;
p.chuku(n);
for(int i=q-1;i>=0;--i)
{
if(t[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
for(int i=w-1;i>=0;--i)
{
if(carr[i].number==n)cout<<"需要付款"<<carr[i].pay()<<"元"<<endl;
}
for(int i=e-1;i>=0;--i)
{
if(car[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
play0();
}
void play3(){
if(p.a[0][0]==0)cout<<"一号车位没有车"<<endl;
if(p.a[0][0]==1)cout<<"一号车位是卡车"<<endl;
if(p.a[0][0]==2)cout<<"一号车位是客车"<<endl;
if(p.a[0][0]==3)cout<<"一号车位是小轿车"<<endl;
if(p.a[1][0]==0)cout<<"二号车位没有车"<<endl;
if(p.a[1][0]==1)cout<<"二号车位是卡车"<<endl;
if(p.a[1][0]==2)cout<<"二号车位是客车"<<endl;
if(p.a[1][0]==3)cout<<"二号车位是小轿车"<<endl;
if(p.a[2][0]==0)cout<<"三号车位没有车"<<endl;
if(p.a[2][0]==1)cout<<"三号车位是卡车"<<endl;
if(p.a[2][0]==2)cout<<"三号车位是客车"<<endl;
if(p.a[2][0]==3)cout<<"三号车位是小轿车"<<endl;
cout<<"一共停了"<<p.sum<<"辆车"<<endl;
cout<<"卡车停了"<<p.trucknum<<"辆车"<<endl;
cout<<"客车停了"<<p.carriagenum<<"辆车"<<endl;
cout<<"小轿车停了"<<p.carnum<<"辆车"<<endl;
play0();
}
void play0(){
cout<<"本系统包含的功能如下:"<<endl;
cout<<" 1为新来车辆分配车位"<<endl;
cout<<" 2开走车辆"<<endl;
cout<<" 3统计各类车辆的数量"<<endl;
cout<<" 0退出系统"<<endl;
cout<<"请选择:";
int n;
cin>>n;
switch(n)
{
case 0:
cout<<" 正在退出系统";
printf("-\b"); Sleep(500);
printf("/\b");Sleep(500);
printf("|\b");Sleep(500);
printf("\\\b");Sleep(500);
printf("-\b"); Sleep(500);
printf("/\b");Sleep(500);
printf("|\b");Sleep(500);
printf("\\\b");Sleep(500);
cout<<" \r成功退出系统"<<endl;
break;
case 1:play1();break;
case 2:play2();break;
case 3:play3();break;
}
}
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
class antomobile{
public:
double money;//车费
int number;//车牌
int year;//使用年限
int time;//停车时间
int p=0;//停车状态
//int weight=0;//重量
//int people=0;//载客
//int gas=0;//排气
virtual double pay()
{
return money;
}//虚函数pay方法
virtual ~antomobile(){};//析构函数
};
class truck:public antomobile{
public:
int weight;
truck()
{
number=0;
year=0;
time=0;
weight=0;
}
friend istream &operator>>(istream &input, truck &D )
{
cout<<"请输入卡车车牌"<<endl;
input >> D.number;
cout<<"请输入卡车年限"<<endl;
input>> D.year;
cout<<"请输入卡车载重"<<endl;
input>>D.weight;
cout<<"请输入卡车停车时间"<<endl;
input>>D.time;
return input;
}
double pay(){
money=2*time;
return money;
}
~truck(){};
};
class carriage:public antomobile{
public:
int people=0;
friend istream &operator>>( istream &input, carriage &D )
{
cout<<"请输入客车车牌"<<endl;
input >> D.number;
cout<<"请输入客车年限"<<endl;
input>> D.year;
cout<<"请输入客车载客"<<endl;
input>>D.people;
cout<<"请输入客车停车时间"<<endl;
input>>D.time;
return input;
}
carriage()
{
number=0;
year=0;
time=0;
people=0;
}
double pay(){
money=(1.5)*time;
return money;
}
~carriage(){};
};
class car:public antomobile{
public:
int gas=0;
friend istream &operator>>( istream &input, car &D )
{
cout<<"请输入小轿车车牌"<<endl;
input >> D.number;
cout<<"请输入小轿车年限"<<endl;
input>> D.year;
cout<<"请输入小轿车排气"<<endl;
input>>D.gas;
cout<<"请输入小轿车停车时间"<<endl;
input>>D.time;
return input;
}
car()
{
number=0;
year=0;
time=0;
gas=0;
}
double pay(){
money=1*time;
return money;
}
~car(){};
};
class park{
//卡车1轿车2小车3
public:
int a[3][2];
int sum;//总车数
int trucknum;//卡车数
int carriagenum;//轿车数
int carnum;//小车数
park(){
int a[3][2]={{0,0},{0,0},{0,0}};
int sum=0;
int trucknum=0;
int carriagenum=0;
int carnum=0;
}
void tingche(int n,int m)//n是车子类型1-3,m是车牌号
{
for(int i=0;i<3;++i)
{
if(a[i][0]==0){a[i][0]=n;a[i][1]=m;break;}
}
switch(n){
case 1:trucknum++;break;
case 2:carriagenum++;break;
case 3:carnum++;break;
}
sum++;
}
void chuku(int n)//n是车牌号
{
int s=0;
for(int i=0;i<3;++i)
{
if(a[i][1]==n)s=i;
}
switch(a[s][0]){
case 1:trucknum--;break;
case 2:carriagenum--;break;
case 3:carnum--;break;
}
a[s][0]=0;
a[s][1]=0;
sum--;
}
};
park p;
truck t[100];int q=0;
carriage carr[100];int w=0;
car car[100];int e=0;
void play0();//主页面
void play1();//停车页面
void play2();//开车页面
void play3();//统计页面
int main()
{ cout<<" 版权所有\\欢迎使用本系统/翻录必究 "<<endl;
play0();
return 0;
}
void play1(){
if(p.sum>=3){cout<<"没有多余的车位了"<<endl;play0();}
cout<<" a为卡车分配停车位"<<endl;
cout<<" b为客车分配停车位"<<endl;
cout<<" c为小较车分配停车位"<<endl;
cout<<"请选择:";
char n;
cin>>n;
switch(n){
case 'a':
cin>>t[q];t[q].p=1;p.tingche(1,t[q].number);++q;play0();
break;
case 'b':
cin>>carr[w];carr[w].p=1;p.tingche(2,carr[w].number);++w;play0();
break;
case 'c':
cin>>car[e];car[e].p=1;p.tingche(3,car[e].number);++e;play0();
break;
}
}
void play2(){
int n;
cout<<"请输入开走车辆的车牌"<<endl;
cin>>n;
p.chuku(n);
for(int i=q-1;i>=0;--i)
{
if(t[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
for(int i=w-1;i>=0;--i)
{
if(carr[i].number==n)cout<<"需要付款"<<carr[i].pay()<<"元"<<endl;
}
for(int i=e-1;i>=0;--i)
{
if(car[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
play0();
}
void play3(){
if(p.a[0][0]==0)cout<<"一号车位没有车"<<endl;
if(p.a[0][0]==1)cout<<"一号车位是卡车"<<endl;
if(p.a[0][0]==2)cout<<"一号车位是客车"<<endl;
if(p.a[0][0]==3)cout<<"一号车位是小轿车"<<endl;
if(p.a[1][0]==0)cout<<"二号车位没有车"<<endl;
if(p.a[1][0]==1)cout<<"二号车位是卡车"<<endl;
if(p.a[1][0]==2)cout<<"二号车位是客车"<<endl;
if(p.a[1][0]==3)cout<<"二号车位是小轿车"<<endl;
if(p.a[2][0]==0)cout<<"三号车位没有车"<<endl;
if(p.a[2][0]==1)cout<<"三号车位是卡车"<<endl;
if(p.a[2][0]==2)cout<<"三号车位是客车"<<endl;
if(p.a[2][0]==3)cout<<"三号车位是小轿车"<<endl;
cout<<"一共停了"<<p.sum<<"辆车"<<endl;
cout<<"卡车停了"<<p.trucknum<<"辆车"<<endl;
cout<<"客车停了"<<p.carriagenum<<"辆车"<<endl;
cout<<"小轿车停了"<<p.carnum<<"辆车"<<endl;
play0();
}
void play0(){
cout<<"本系统包含的功能如下:"<<endl;
cout<<" 1为新来车辆分配车位"<<endl;
cout<<" 2开走车辆"<<endl;
cout<<" 3统计各类车辆的数量"<<endl;
cout<<" 0退出系统"<<endl;
cout<<"请选择:";
int n;
cin>>n;
switch(n)
{
case 0:
cout<<" 正在退出系统";
printf("-\b"); Sleep(500);
printf("/\b");Sleep(500);
printf("|\b");Sleep(500);
printf("\\\b");Sleep(500);
printf("-\b"); Sleep(500);
printf("/\b");Sleep(500);
printf("|\b");Sleep(500);
printf("\\\b");Sleep(500);
cout<<" \r成功退出系统"<<endl;
break;
case 1:play1();break;
case 2:play2();break;
case 3:play3();break;
}
}
#include <iostream>
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
class antomobile{
public:
double money;//车费
int number;//车牌
int year;//使用年限
int time;//停车时间
int p=0;//停车状态
//int weight=0;//重量
//int people=0;//载客
//int gas=0;//排气
virtual double pay()
{
return money;
}//虚函数pay方法
virtual ~antomobile(){};//析构函数
};
class truck:public antomobile{
public:
int weight;
truck()
{
number=0;
year=0;
time=0;
weight=0;
}
friend istream &operator>>(istream &input, truck &D )
{
cout<<"请输入卡车车牌"<<endl;
input >> D.number;
cout<<"请输入卡车年限"<<endl;
input>> D.year;
cout<<"请输入卡车载重"<<endl;
input>>D.weight;
cout<<"请输入卡车停车时间"<<endl;
input>>D.time;
return input;
}
double pay(){
money=2*time;
return money;
}
~truck(){};
};
class carriage:public antomobile{
public:
int people=0;
friend istream &operator>>( istream &input, carriage &D )
{
cout<<"请输入客车车牌"<<endl;
input >> D.number;
cout<<"请输入客车年限"<<endl;
input>> D.year;
cout<<"请输入客车载客"<<endl;
input>>D.people;
cout<<"请输入客车停车时间"<<endl;
input>>D.time;
return input;
}
carriage()
{
number=0;
year=0;
time=0;
people=0;
}
double pay(){
money=(1.5)*time;
return money;
}
~carriage(){};
};
class car:public antomobile{
public:
int gas=0;
friend istream &operator>>( istream &input, car &D )
{
cout<<"请输入小轿车车牌"<<endl;
input >> D.number;
cout<<"请输入小轿车年限"<<endl;
input>> D.year;
cout<<"请输入小轿车排气"<<endl;
input>>D.gas;
cout<<"请输入小轿车停车时间"<<endl;
input>>D.time;
return input;
}
car()
{
number=0;
year=0;
time=0;
gas=0;
}
double pay(){
money=1*time;
return money;
}
~car(){};
};
void Menu();//主页面
void enterPark();//停车页面
void driveAway();//开车页面
void display();//统计页面
class park{
//卡车1轿车2小车3
public:
int a[3][2];
int sum;//总车数
int trucknum;//卡车数
int carriagenum;//轿车数
int carnum;//小车数
park(){
int a[3][2]={{0,0},{0,0},{0,0}};
int sum=0;
int trucknum=0;
int carriagenum=0;
int carnum=0;
}
void stopCar(int n,int m)//n是车子类型1-3,m是车牌号
{
for(int i=0;i<3;++i)
{
if(a[i][1]==m){cout<<"车牌号重复,请重新输入"<<endl;enterPark();}
}
for(int i=0;i<3;++i)
{
if(a[i][0]==0){a[i][0]=n;a[i][1]=m;break;}
}
switch(n){
case 1:trucknum++;break;
case 2:carriagenum++;break;
case 3:carnum++;break;
}
sum++;
}
void driveAwayGo(int n)//n是车牌号
{
int s=0;
for(int i=0;i<3;++i)
{
if(a[i][1]==n)s=i;
}
switch(a[s][0]){
case 1:trucknum--;break;
case 2:carriagenum--;break;
case 3:carnum--;break;
}
a[s][0]=0;
a[s][1]=0;
sum--;
}
};
park p;
truck t[100];int q=0;
carriage carr[100];int w=0;
car car[100];int e=0;
int main()
{ Menu();
return 0;
}
void enterPark(){
if(p.sum>=3){cout<<"没有多余的车位了"<<endl;Menu();}
cout<<" a为卡车分配停车位"<<endl;
cout<<" b为客车分配停车位"<<endl;
cout<<" c为小较车分配停车位"<<endl;
cout<<"请选择:";
char n;
cin>>n;
switch(n){
case 'a':
cin>>t[q];t[q].p=1;p.stopCar(1,t[q].number);++q;Menu();
break;
case 'b':
cin>>carr[w];carr[w].p=1;p.stopCar(2,carr[w].number);++w;Menu();
break;
case 'c':
cin>>car[e];car[e].p=1;p.stopCar(3,car[e].number);++e;Menu();
break;
}
}
void driveAway(){
int n;
cout<<"请输入开走车辆的车牌"<<endl;
cin>>n;
p.driveAwayGo(n);
for(int i=q-1;i>=0;--i)
{
if(t[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
for(int i=w-1;i>=0;--i)
{
if(carr[i].number==n)cout<<"需要付款"<<carr[i].pay()<<"元"<<endl;
}
for(int i=e-1;i>=0;--i)
{
if(car[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
Menu();
}
void display(){
for(int i=0;i<3;++i){
if(p.a[i][0]==0)cout<<i+1<<"号车位没有车"<<endl;
if(p.a[i][0]==1)cout<<i+1<<"号车位是卡车"<<endl;
if(p.a[i][0]==2)cout<<i+1<<"号车位是客车"<<endl;
if(p.a[i][0]==3)cout<<i+1<<"号车位是小轿车"<<endl;
}
cout<<"一共停了"<<p.sum<<"辆车"<<endl;
cout<<"卡车停了"<<p.trucknum<<"辆车"<<endl;
cout<<"客车停了"<<p.carriagenum<<"辆车"<<endl;
cout<<"小轿车停了"<<p.carnum<<"辆车"<<endl;
Menu();
}
void Menu(){
cout<<"本系统包含的功能如下:"<<endl;
cout<<" 1为新来车辆分配车位"<<endl;
cout<<" 2开走车辆"<<endl;
cout<<" 3统计各类车辆的数量"<<endl;
cout<<" 0退出系统"<<endl;
cout<<"请选择:";
int n;
cin>>n;
switch(n)
{
case 0:
cout<<" \r成功退出系统"<<endl;
break;
case 1:enterPark();break;
case 2:driveAway();break;
case 3:display();break;
}
}
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
class antomobile{
public:
double money;//车费
int number;//车牌
int year;//使用年限
int time;//停车时间
int p=0;//停车状态
//int weight=0;//重量
//int people=0;//载客
//int gas=0;//排气
virtual double pay()
{
return money;
}//虚函数pay方法
virtual ~antomobile(){};//析构函数
};
class truck:public antomobile{
public:
int weight;
truck()
{
number=0;
year=0;
time=0;
weight=0;
}
friend istream &operator>>(istream &input, truck &D )
{
cout<<"请输入卡车车牌"<<endl;
input >> D.number;
cout<<"请输入卡车年限"<<endl;
input>> D.year;
cout<<"请输入卡车载重"<<endl;
input>>D.weight;
cout<<"请输入卡车停车时间"<<endl;
input>>D.time;
return input;
}
double pay(){
money=2*time;
return money;
}
~truck(){};
};
class carriage:public antomobile{
public:
int people=0;
friend istream &operator>>( istream &input, carriage &D )
{
cout<<"请输入客车车牌"<<endl;
input >> D.number;
cout<<"请输入客车年限"<<endl;
input>> D.year;
cout<<"请输入客车载客"<<endl;
input>>D.people;
cout<<"请输入客车停车时间"<<endl;
input>>D.time;
return input;
}
carriage()
{
number=0;
year=0;
time=0;
people=0;
}
double pay(){
money=(1.5)*time;
return money;
}
~carriage(){};
};
class car:public antomobile{
public:
int gas=0;
friend istream &operator>>( istream &input, car &D )
{
cout<<"请输入小轿车车牌"<<endl;
input >> D.number;
cout<<"请输入小轿车年限"<<endl;
input>> D.year;
cout<<"请输入小轿车排气"<<endl;
input>>D.gas;
cout<<"请输入小轿车停车时间"<<endl;
input>>D.time;
return input;
}
car()
{
number=0;
year=0;
time=0;
gas=0;
}
double pay(){
money=1*time;
return money;
}
~car(){};
};
void Menu();//主页面
void enterPark();//停车页面
void driveAway();//开车页面
void display();//统计页面
class park{
//卡车1轿车2小车3
public:
int a[3][2];
int sum;//总车数
int trucknum;//卡车数
int carriagenum;//轿车数
int carnum;//小车数
park(){
int a[3][2]={{0,0},{0,0},{0,0}};
int sum=0;
int trucknum=0;
int carriagenum=0;
int carnum=0;
}
void stopCar(int n,int m)//n是车子类型1-3,m是车牌号
{
for(int i=0;i<3;++i)
{
if(a[i][1]==m){cout<<"车牌号重复,请重新输入"<<endl;enterPark();}
}
for(int i=0;i<3;++i)
{
if(a[i][0]==0){a[i][0]=n;a[i][1]=m;break;}
}
switch(n){
case 1:trucknum++;break;
case 2:carriagenum++;break;
case 3:carnum++;break;
}
sum++;
}
void driveAwayGo(int n)//n是车牌号
{
int s=0;
for(int i=0;i<3;++i)
{
if(a[i][1]==n)s=i;
}
switch(a[s][0]){
case 1:trucknum--;break;
case 2:carriagenum--;break;
case 3:carnum--;break;
}
a[s][0]=0;
a[s][1]=0;
sum--;
}
};
park p;
truck t[100];int q=0;
carriage carr[100];int w=0;
car car[100];int e=0;
int main()
{ Menu();
return 0;
}
void enterPark(){
if(p.sum>=3){cout<<"没有多余的车位了"<<endl;Menu();}
cout<<" a为卡车分配停车位"<<endl;
cout<<" b为客车分配停车位"<<endl;
cout<<" c为小较车分配停车位"<<endl;
cout<<"请选择:";
char n;
cin>>n;
switch(n){
case 'a':
cin>>t[q];t[q].p=1;p.stopCar(1,t[q].number);++q;Menu();
break;
case 'b':
cin>>carr[w];carr[w].p=1;p.stopCar(2,carr[w].number);++w;Menu();
break;
case 'c':
cin>>car[e];car[e].p=1;p.stopCar(3,car[e].number);++e;Menu();
break;
}
}
void driveAway(){
int n;
cout<<"请输入开走车辆的车牌"<<endl;
cin>>n;
p.driveAwayGo(n);
for(int i=q-1;i>=0;--i)
{
if(t[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
for(int i=w-1;i>=0;--i)
{
if(carr[i].number==n)cout<<"需要付款"<<carr[i].pay()<<"元"<<endl;
}
for(int i=e-1;i>=0;--i)
{
if(car[i].number==n)cout<<"需要付款"<<t[i].pay()<<"元"<<endl;
}
Menu();
}
void display(){
for(int i=0;i<3;++i){
if(p.a[i][0]==0)cout<<i+1<<"号车位没有车"<<endl;
if(p.a[i][0]==1)cout<<i+1<<"号车位是卡车"<<endl;
if(p.a[i][0]==2)cout<<i+1<<"号车位是客车"<<endl;
if(p.a[i][0]==3)cout<<i+1<<"号车位是小轿车"<<endl;
}
cout<<"一共停了"<<p.sum<<"辆车"<<endl;
cout<<"卡车停了"<<p.trucknum<<"辆车"<<endl;
cout<<"客车停了"<<p.carriagenum<<"辆车"<<endl;
cout<<"小轿车停了"<<p.carnum<<"辆车"<<endl;
Menu();
}
void Menu(){
cout<<"本系统包含的功能如下:"<<endl;
cout<<" 1为新来车辆分配车位"<<endl;
cout<<" 2开走车辆"<<endl;
cout<<" 3统计各类车辆的数量"<<endl;
cout<<" 0退出系统"<<endl;
cout<<"请选择:";
int n;
cin>>n;
switch(n)
{
case 0:
cout<<" \r成功退出系统"<<endl;
break;
case 1:enterPark();break;
case 2:driveAway();break;
case 3:display();break;
}
}