欢迎来到天天文库
浏览记录
ID:44904077
大小:71.50 KB
页数:24页
时间:2019-11-03
《c++题库编程题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.//2-5#include#include#includeusingnamespacestd;classTriangle{inta,b,c;public:doubleArea(){doubles=(a+b+c)/2;returnsqrt(s*(s-a)*(s-b)*(s-c));};intPerimeter(){returna+b+c;}voidInput(){cin>>a>>b>>c;}};voidmain(){Trianglet1;t1.Input();cout<2、()<<""<inlineintmax(inta,intb){if(a>b)returna;elsereturnb;}inlineintmax(inta,intb,intc){returnmax(a,max(b,c));}voidmain(){intx=21,y=15,z=22,d;d=max(x,max(y,z));cout<intoverload(intn);charoverload(char3、n);voidmain(){intn;chars;cout<<"输入5";cin>>n;..cout<<"n="<>s;cout<<"a=";cout<4、h);intmain(){charch;while((ch=getchar())!='')cout<='a'&&ch<='z')returnch-32;elsereturnch+32;}//3-1#includeusingstd::cout;usingstd::endl;intMin(inta,intb){return(a5、turn(Min(a,b)usingnamespacestd;voidArea6、(floatr){cout<<"thecircle'sareais:"<<3.14*r*r<7、>usingnamespacestd;voidSort(inta[],intn){boolflag;for(inti=0;ia[j]){inttemp=a[j-1];a[j-1]=a[j];a[j]=temp;flag=true;}if(!flag)break;}for(intm=0;m8、ti=0;ib[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
2、()<<""<inlineintmax(inta,intb){if(a>b)returna;elsereturnb;}inlineintmax(inta,intb,intc){returnmax(a,max(b,c));}voidmain(){intx=21,y=15,z=22,d;d=max(x,max(y,z));cout<intoverload(intn);charoverload(char
3、n);voidmain(){intn;chars;cout<<"输入5";cin>>n;..cout<<"n="<>s;cout<<"a=";cout<4、h);intmain(){charch;while((ch=getchar())!='')cout<='a'&&ch<='z')returnch-32;elsereturnch+32;}//3-1#includeusingstd::cout;usingstd::endl;intMin(inta,intb){return(a5、turn(Min(a,b)usingnamespacestd;voidArea6、(floatr){cout<<"thecircle'sareais:"<<3.14*r*r<7、>usingnamespacestd;voidSort(inta[],intn){boolflag;for(inti=0;ia[j]){inttemp=a[j-1];a[j-1]=a[j];a[j]=temp;flag=true;}if(!flag)break;}for(intm=0;m8、ti=0;ib[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
4、h);intmain(){charch;while((ch=getchar())!='')cout<='a'&&ch<='z')returnch-32;elsereturnch+32;}//3-1#includeusingstd::cout;usingstd::endl;intMin(inta,intb){return(a5、turn(Min(a,b)usingnamespacestd;voidArea6、(floatr){cout<<"thecircle'sareais:"<<3.14*r*r<7、>usingnamespacestd;voidSort(inta[],intn){boolflag;for(inti=0;ia[j]){inttemp=a[j-1];a[j-1]=a[j];a[j]=temp;flag=true;}if(!flag)break;}for(intm=0;m8、ti=0;ib[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
5、turn(Min(a,b)usingnamespacestd;voidArea
6、(floatr){cout<<"thecircle'sareais:"<<3.14*r*r<7、>usingnamespacestd;voidSort(inta[],intn){boolflag;for(inti=0;ia[j]){inttemp=a[j-1];a[j-1]=a[j];a[j]=temp;flag=true;}if(!flag)break;}for(intm=0;m8、ti=0;ib[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
7、>usingnamespacestd;voidSort(inta[],intn){boolflag;for(inti=0;ia[j]){inttemp=a[j-1];a[j-1]=a[j];a[j]=temp;flag=true;}if(!flag)break;}for(intm=0;m8、ti=0;ib[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
8、ti=0;ib[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
此文档下载收益归作者所有