6.4 c++prozuoye

6.4 c++prozuoye,第1张

概述本文章向大家介绍6.4 c++prozuoye,主要包括6.4 c++prozuoye使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

#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所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1264564.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存