资源描述:
《book类 C++程序代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include"iostream"#include"string"#include"vector"#include"cmath"#include"algorithm"usingnamespacestd;inlinevoidkeep_window_open(){charch;cin>>ch;}structISBN{charww;intaa;intbb;intcc;intdd;charee;};structCopyright{intyy;intmm;intrr;};classbook{public:book(){
2、};book(charw,inta,intb,intc,intd,chare,stringg,stringh,inty,intm,intr,charn);book(book&p);voidshowISBN();voidshowbkname();voidshowauthor();voidshowcopyright();voidshowborrow();private:ISBNisbn;stringbkname;stringauthor;Copyrightcopyright;charborrow;};book::b
3、ook(charw,inta,intb,intc,intd,chare,stringg,stringh,inty,intm,intr,charn){isbn.ww=w;isbn.aa=a;isbn.bb=b;isbn.cc=c;isbn.dd=d;isbn.ee=e;bkname=g;author=h;copyright.yy=y;copyright.mm=m;copyright.rr=r;borrow=n;}book::book(book&p){isbn.ww=p.isbn.ww;isbn.aa=p.isbn
4、.aa;isbn.bb=p.isbn.bb;isbn.cc=p.isbn.cc;isbn.dd=p.isbn.dd;isbn.ee=p.isbn.ee;bkname=p.bkname;author=p.author;copyright.yy=p.copyright.yy;copyright.mm=p.copyright.mm;copyright.rr=p.copyright.rr;borrow=p.borrow;}voidbook::showISBN(){if(isbn.ww=='y')cout<<"ISBN号
5、是:"<6、ht(){cout<<"版权日期截止时间是:"<>g;cout<<"请输入作者:"<>h;cout<<"请输
7、入版权日期截止时间:";inty,m,r;cin>>y>>m>>r;cout<<"此书已经借出吗?是:y;否:n."<>n;cout<<"请输入ISBN号(四个数字或三个数字加一个字母):";inta,b,c,d;chare,f;cout<<"前三个数字:";cin>>a>>b>>c;cout<<"最后一位是数字吗(输入y或n)?";cin>>e;if(e=='y'){cout<<"输入一个数字:";cin>>d;}else{cout<<"输入一个字母:";cin>>f;}boo
8、kbook1('y',a,b,c,d,' ',g,h,y,m,r,n);bookbook2('n',a,b,c,0,f,g,h,y,m,r,n);bookbook3;if(e=='y')book3=book(book1);elsebook3=book(book2);book3.showISBN();book3.showbkname();book3.showauthor();book3