数组定义如下,错误的是()
A. int x[ ][3]={0};
B. int x[2][3]={{1,2},{3,4},{5,6}};
C. int x[ ][3]={{1,2,3},{4,5,6}};
D. int x[2][3]={1,2,3,4,5,6};
有以下程序:#include"stdio.h"voidmain(){inta[4][4]={{1,4,3,2},{8,6,5,7},{3,7,2,5},{4,8,6,1}},i,j,k,t;for(i=0;i<4;i++)for(j=0;j<3;j++)for(k=j+1;k<4;k++)if(a[j][i]>a[k][i]){t=a[j][i];a[j][i]=a[k][i];a[k][i]=t;}//按列排序for(i=0;i<4;i++)printf("%d,",a[i][i]);}程序运行后的输出结果是()
A. 1,6,5,7,
B. 8,7,3,1,
C. 4,7,5,2,
D. 1,6,2,1,
有以下程序:#include"stdio.h"voidmain(){inta[4][4]={{1,4,3,2},{8,6,5,7},{3,7,2,5},{4,8,6,1}},i,j,k,t;for(i=0;i<3;i++)for(k=i+1;k<4;k++)if(a[i][i]
A. 6,2,1,1,
B. 6,4,3,2,
C. 1,1,2,6,
D. 2,3,4,6,
有以下程序 #include #include main() { char x[]=”STRING”; x[0]=0;x[1]=’\0’;x[2]=’0’; printf(”%d %d\n”,sizeof(x),strlen(x)); } 程序运行后的输出结果是
A. 6 1
B. 7 0
C. 6 3
D. 7 1