1、7.1 数组及数组元素数组及数组元素7.1.1 一维数组一维数组a1a2a3a4a5a6a7a8a9a104531269780int a10,i,j,k,t;初始化数组初始化数组i=0;i9;k=i;j=i+1;j9;ajak?YNk=jt=ak;ak=ai;ai=t;共比共比9轮轮记住该换的位置记住该换的位置寻找第寻找第k小的数小的数aja00 a01 a02 a03a10 a11 a12 a13a20 a21 a22 a23a0 a1 a2 a3 a4 a5 a6 a7a8 a9a10 a11 a12 a13 a14111222323444445iiiiiiiiilenlen=2len=3
2、iiiiilen=4len=5sT o d da y yi isM o n d a y 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 T o d a y 0 s M o n d a y 0T o d a y M o n d a y 0s+i+npxpy&a=ff00&b=ff02 3 4 2 5 1 3 4 2 5 1a0 a1 a2 a3 a4 a5 a6 a7a8 a9a10 a11 a12 a13 a1411910-1054687-2312-3 main()char*line=C+,Fortran,Basic,Pascal,Foxbase;int n=5
3、;shellsort(line,n);writeline(line,n);shellsort(v,n)char*v;int n;char*t;int i,j,k;for(i=0;ii;j-)if(strcmp(vj-1,vj)0)t=vj;vj=vj-1;vj-1=t;writeline(linp,n)char*linp;int n;int i;for(i=0;in;i+)printf(%sn,linpi);:T Th hi is s i is sa as st tr ri in ng g00 7.12 7.12 。7.12 7.12 7.12 7.12 1 10 02 20 0(1+x+x2+x3)dx(x/(1+x2)dx3.53.50 00 a h b 0 a h b x xf(x)f(x)y y102030ijk