6.3w+
社区成员
#include <iostream>
using std::cout; using std::endl;
using std::ends;
int main()
{
int a[]={1,2,3,4,5,6};
int b[7];int c[5]; // change to 7 and 5
int i,j;
b[0]=a[0];b[1]=a[1];
b[2]=8;
for(i=2;i <6;i++)
b[i+1]=a[i];
for(i=0;i <7;i++)
cout <<b[i] <<ends;
cout<<endl;
for(j=0;j <4;j++)
c[j]=a[j];
c[4]=a[5];
for(j=0;j <5;j++)
cout <<c[j] <<ends;
cout<<endl;
return 0;
}