2、1,3,7,15,整型数组元素平移0123413579t=a[0];t135791a[4]=t;for(i=1;i<=4;i++)a[i-1]=a[i];二维数组的定义数据类型数组名[表达式1][表达式2]二维数组的初始化inta[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};或inta[3][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12}};a[0]0321476581110912123a[1]a[2]二维数组按行存放二维数组#include3、anip>inta[3][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12}};for(inti=0;i<3;i++){for(intk=0;k<4;k++)cout<4、6,7};inti,s=0;for(i=0;i<3;i++)s+=a[i][i]+a[i][3-i-1];30数组求极值max=0;for(i=0;i<5;i++)if(a[i]>max)max=a[i];43210max34700-3-4-7-2-53472534725数组求极值方法一max=a[0];for(i=1;i<5;i++)if(a[i]>max)max=a[i];43210max473数组求极值方法二m=0;for(i=1;i<5;i++)if(a[i]>a[m])m=i;012m=2;
5、最大值:a[m]=7;3472543210m'A'=65'a'=97''=32'0'=48常见字符的ASCII码字符数组字符的ASCII码转义字符7响铃a34双引号"39单引号'92反斜杠\13回车r8退格b9跳到下一制表位t10回车换行ASCII码含义转义字符字符数组与串charsa[]={'N','B','A'};'N''B''A'sa201charsb[]="NBA";'N''B''A'' 'sb201334字符数组与串'N''B''A'' 'sb2013charsa[]=
6、{'N','B','A',' '};charsb[]="NBA";44sa201'N''B''A'' '3'0'与' '' '=0逻辑假'0'=48逻辑真' ''0'区分'0'与' '1字符数组与串[2009.3.8]以下程序段的运行结果是charc[20]="examination";c[4]=0;cout<