欢迎来到天天文库
浏览记录
ID:48418652
大小:72.00 KB
页数:24页
时间:2020-01-24
《c++题库编程题.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
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)
3、;charoverload(charn);voidmain(){intn;chars;cout<<"输入5";cin>>n;..cout<<"n="<>s;cout<<"a=";cout<4、cestd;inlinechartrans(charch);intmain(){charch;while((ch=getchar())!='')cout<='a'&&ch<='z')returnch-32;elsereturnch+32;}//3-1#includeusingstd::cout;usingstd::endl;intMin(inta,intb){return(a5、6、2#includeusingnamespacestd;voidArea(floatr){cout<<"thecircle'sareais:"<<3.14*r*r<7、{Area(5);Area(3,3);Area(3,5,4);}//3-3#includeusingnamespacestd;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、t<b[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
4、cestd;inlinechartrans(charch);intmain(){charch;while((ch=getchar())!='')cout<='a'&&ch<='z')returnch-32;elsereturnch+32;}//3-1#includeusingstd::cout;usingstd::endl;intMin(inta,intb){return(a
5、
6、2#includeusingnamespacestd;voidArea(floatr){cout<<"thecircle'sareais:"<<3.14*r*r<7、{Area(5);Area(3,3);Area(3,5,4);}//3-3#includeusingnamespacestd;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、t<b[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
7、{Area(5);Area(3,3);Area(3,5,4);}//3-3#includeusingnamespacestd;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、t<b[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
8、t<b[j]){floattemp=b[j-1];b[j-1]=b[j];b[j]=temp;
此文档下载收益归作者所有