这有什么错误啊,说返回类型没有被定义
#include<iostream>using namespace std;
struct bop
{
char fullname[20];
char title[20];
char bopname[20];
int preference;
}
int main()
{
bop arry[5];
bop arry[1]={Wimp Macho,Wimp Macho,gou,1};
bop arry[2]={Raki Rhodes,Junior Programmer,mao,2};
bop arry[3]={Hoppy Hipman,MIPS,yu,3};
bop arry[4]={Celia laiter,Analyst Trainee,xiong,2};
bop arry[5]={Ydsha Sjfdl,DJFA alf,zhu,1};
cout<<"Benevolent Order of Programmers Report\n";
cout<<"a. display by name b. display by title\n";
cout<<"c. display by bopname d. display by preference\n";
cout<<"q. auit";
cout<<"Enter your choice:";
char ch;
cin.get(ch);
int i;
for(i=1;i<=5;i++)
{
switch(ch)
{
case'a':cout<<arry[i].fullname<<"\n";break;
case'b':cout<<arry[i].title<<"\n";break;
case'c':cout<<arry[i].bopname<<"\n";break;
case'd':if(arry[i].preference=='1'
cout<<arry[i].fullname<<"\n";break;
else if(arry[i].preference=='2'
cout<<arry[i].title<<"\n";break;
else if(arry[i].preference=='3'
cout<<arry[i].bopname<<"\n";break;
case'q':cout<<"quit\n";break;
defaut:cout"it is wrong";
}
}
system("pause");
return 0:
}
还有如果要在switch之后再次回到cin.get()也就是说可以多次输入输出怎么办