C++作业题与答案(4)
#include\void main() { int m,n,a;
cout<<\cin>>m,n;
a=Fabricate(m,n); cout<
/*/ e15
#include
{ int a[10]={34,91,83,56,29,93,56,12,88,72}; for (int i=0;i<10;i++) cout<
void findmin(int x[],int n) { int k,t=0;
for(int i=t+1;i /*34 91 83 56 29 93 56 12 88 72 第11位数最小,为:12 neworder: 12 91 83 56 29 93 56 34 88 72 Press any key to continue */ /*/ e16 #include void main() { int n; int a[10]={0,1,2,3,4,5,6,7,8,9}; for(int i=0;i<10;i++) cout<>n; ins(a,n,10); for(i=0;i<10;i++) cout< void ins(int x[],int n,int num) { int min,t; if(x[num-1]>n) {cout< for(int i=0;i<(num-1);i++) {t=i; for(int j=i+1;j else cout< 0 1 2 3 4 5 6 7 8 9 n=8 9 0 1 2 3 4 5 6 7 8 8 Press any key to continue*/ /*/ e17 #include int*findmax(int*array,int size,int& index); int*ipt; void main() {int a[10]={33,54,91,67,82,37,85,63,19,68}; int*maxaddr;int idx; for(int i=0;i<10;i++)cout< cout<<\ <<\ <<\int*findmax(int*array,int size,int&index) { index=0; for(int i=1;i if(array[i]>array[index])index=i; if(index!=0) return array+index; } //*/ /* 0 0x0012FF58 33 1 0x0012FF5C 54 2 0x0012FF60 91 3 0x0012FF64 67 4 0x0012FF68 82 5 0x0012FF6C 37 6 0x0012FF70 85 7 0x0012FF74 63 8 0x0012FF78 19 9 0x0012FF7C 68 the index of maximum elemen is:2 the address of it is:0x0012FF60 the value of it is:91 Press any key to continue */ /*/e18 #include int strcmp(const char* str1,const char* str2) { if (strlen(str1)!=strlen(str2)) { if (strlen(str1)>strlen(str2)) return 1; else return -1; } else { int t=strlen(str1); for(int i=0;i void main() { char *a=\ char *b=\ cout< Press any key to continue*/ //*/ /*e19 #include int fcmpa(const void* a1,const void* b1) { return (*(int *)b1+*(int *)b1/10)-(*(int *)a1+*(int *)a1/10); } int fcmpb(const void* a2,const void* b2) { return *(double *) a2 > *(double *) b2 ? 1 : -1; } int fcmpc(const void* a3,const void* b3) { if(strlen(*(char**)a3)==strlen(*(char**)b3)) return strcmp(*(char**)a3, *(char**)b3); return strlen(*(char**)a3)-strlen(*(char**)b3); } void main() { int a[10]={12,32,42,51,8,16,51,21,19,9}; double b[10]={32.1,456.87,332.67,442.0,98.12,451.79,340.12,54.55,99.87,72.5}; char* c[]={\ qsort(a,10,sizeof(int),fcmpa); cout<<\ for(int i=0;i<=9;i++) cout< )/sizeof(*c),sizeof(*c),fcmpc); cout<<\ for(int k=0;k<=9;k++) cout< a[i]after:19 9 8 16 42 51 51 32 21 12 b[i]after:32.1 54.55 72.5 98.12 99.87 332.67 340.12 442 451.79 456.87 c[i]after:a of cap cat size begin enter number certain program Press any key to continue*/ /*/ e20 #include } //*/ //blue.txt //This is a test. //Answer: //Thisisatest.
相关推荐:
- [建筑文档]2018年公需课:专业技术人员创新能力与
- [建筑文档]2013年福建教师招考小学数学历年真题
- [建筑文档]高中信息技术课flash知识点总结 - 图文
- [建筑文档]电工实训 - 图文
- [建筑文档]最高院公告案例分析100篇(民商篇)
- [建筑文档]南开中学高2017级14-15学年(上)期末
- [建筑文档]五粮液集团战略分析
- [建筑文档]鲁教版(2012秋季版)九年级化学 酸碱
- [建筑文档]超星尔雅2017中国哲学概论自整理题库答
- [建筑文档]关于成为海口金盘饮料公司材料独家供货
- [建筑文档]LNG学习资料第一册 基础知识 - 图文
- [建筑文档]四年级品社下册《好大一个家》复习资料
- [建筑文档]现阶段领导权力腐败的特点及发展趋势
- [建筑文档]魏晋南北朝诗歌鉴赏—嵇康
- [建筑文档]坚持追求真爱是理智的行为 正方一辩稿
- [建筑文档]湘西州刑释解教人员帮教安置工作存在的
- [建筑文档]园林工程试题库及答案
- [建筑文档]计算机长期没有向WSUS报告状态
- [建筑文档]日语最新流行语
- [建筑文档]B62-016 景观进场交底专题会议
- 2018年中考语文课内外古诗词鉴赏专题复
- 高考试题研究心得体会
- C语言基础题及答案
- 电气控制及PLC习题及答案
- 都昌小学家长学校汇报材料
- GMAT作文模板正确使用方法
- 俄军办坦克大赛:中国99式有望与豹2A6
- 成本会计练习题
- 酒店餐饮业最流行的5S管理方法
- 2014-2015学年山东省菏泽市高二(下)
- 《黄鹤楼送孟浩然之广陵》教案、说课、
- 2013年结构化学自测题 有答案版
- 2011西安世界园艺博览会游览解说词(附
- 窗口文明单位示范单位创建活动总结
- 2018满分超星尔雅就业课后练习期末答案
- 韶山市城市总体规划-基础资料
- 苏教版第三单元知识点归纳
- 第4章 曲轴模态分析
- 加大查办案件力度的思考
- 武汉CPC导轨介绍