c++提示error: expected `}' at end of input该怎么改
#include<iostream.h>classLIFT{public:intfloor,_floor;intx;voidgo(intx){{cout<<"使用"<<x...
#include<iostream.h>
class LIFT
{
public:
int floor,_floor;
int x;
void go(int x)
{
{cout<<"使用"<<x<<"号电梯"<<endl;
cout<<"输入要去的楼层:"<<endl;
cin>>_floor;
cout<<"电梯到达"<<_floor<<"层"<<endl;
floor=_floor;
} ;
};
void main()
{
int m,n=0,k;
cout<<"欢迎使用电梯"<<endl;
do
{
cout<<"乘坐电梯人数为:"<<endl;
cin>>m;
if(m>16){ cout<<"电梯已超载!"<<endl;
cout<<"乘坐电梯人数为:"<<endl;
cin>>m;}
else {cout<<"电梯启动!"<<endl; n=1;}
}while(n=0);
cout<<"选择要乘坐的电梯:1/2/3:"<<endl;
cin>>k;
LIFT::go(k);
} 展开
class LIFT
{
public:
int floor,_floor;
int x;
void go(int x)
{
{cout<<"使用"<<x<<"号电梯"<<endl;
cout<<"输入要去的楼层:"<<endl;
cin>>_floor;
cout<<"电梯到达"<<_floor<<"层"<<endl;
floor=_floor;
} ;
};
void main()
{
int m,n=0,k;
cout<<"欢迎使用电梯"<<endl;
do
{
cout<<"乘坐电梯人数为:"<<endl;
cin>>m;
if(m>16){ cout<<"电梯已超载!"<<endl;
cout<<"乘坐电梯人数为:"<<endl;
cin>>m;}
else {cout<<"电梯启动!"<<endl; n=1;}
}while(n=0);
cout<<"选择要乘坐的电梯:1/2/3:"<<endl;
cin>>k;
LIFT::go(k);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询