第五章第六章数、指针和引用.docVIP

  • 16
  • 0
  • 约1.63万字
  • 约 34页
  • 2016-10-14 发布于贵州
  • 举报
第五章第六章数、指针和引用

//编程题四.1 #includeiostream.h #includeiomanip.h void main() { int a[11]={1,3,9,9,13,16,19,20,28,40}; int temp1,temp2,number,end,i,j; cout初始数组为:; for(i=0;i10;i++) coutsetw(4)a[i]; coutendl; cout请输入数据; cinnumber; end=a[9]; if(numberend) a[10]=number; else { for(i=0;i10;i++) { if(a[i]number) { temp1=a[i]; a[i]=number; for(j=i+1;j11;j++) {temp2=a[j];a[j]=temp1;temp1=temp2;} break; } } } cout插入后的数据为:; for(i=0;i11;i++) coutsetw(4)a[i]; coutendl; } //编程题四.2 #includeiostream.h #includeiomanip.h #define N 8 void main() { float a[N],m

文档评论(0)

1亿VIP精品文档

相关文档