#include
const int strsize = 100;
using namespace std;
voID show_real_name(struct bop message[],int n);
voID show_job_Title(struct bop message[],int n);
voID show_bop_name(struct bop message[],int n);
voID show_preference(struct bop message[],int n);
voID enter_message(struct bop message[],int n);
struct bop
{
char fullname[strsize]; //real name
char Title[strsize]; //job titel
char bopname[strsize]; //secret BOP name
int preference; //0=fullname,1=Title,2=bopname
};
int main()
{
int n;
struct bop message[5] =
{
{"Wimp Macho","Da shi xiong","da sheng",1},
{"Raki Rhodes","Er shi xiong","tian peng",
{"Celia laiter","Boss","tang seng",
{"Hoppy Hipman","Pao tui","wu jing",2},
{"Pat Hand","Xiao lao di","bai long",0}
};
cout << "Benevolent Order of Programmers Report"< cout << "a)display by name "<<" "<<"b)display by Title "< <<"c)display by bopname "<<" "<<"d)display by preference"< <<"q)quit "< <<"Please enter q to quit"< char choice; while(cin >> choice && choice !='q') { switch(choice) { case 'a' :show_real_name(message,5); cout << endl; break; case 'b' :show_job_Title(message,5); cout < break; case 'c' :show_bop_name(message,5); cout << endl; break; case 'd' :show_preference(message,5); cout < break; default :cout<< "Please enter a choice"< } } return 0; } voID show_real_name(struct bop message[],int n) { for(int i =0;i cout << message[i].fullname< } voID show_job_Title(struct bop message[],int n) { for(int i =0;i cout << message[i].Title< } voID show_bop_name(struct bop message[],int n) { for(int i =0;i cout << message[i].bopname< } voID show_preference(struct bop message[],int n) { for(int i =0;i { if(message[i].preference==0) cout< if(message[i].preference==1) cout< if(message[i].preference==2) cout< } } 以上是内存溢出为你收集整理的6.4 c++prozuoye全部内容,希望文章能够帮你解决6.4 c++prozuoye所遇到的程序开发问题。 如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。 欢迎分享,转载请注明来源:内存溢出
评论列表(0条)