【单选题】下面程序执行后的输出结果是( )。#include #define N 20void fun( int a[], int n, int m ){ int i; for ( i = m; i >= n; i-- ) a[i + 1] = a[i];}int main(){ int i; int a[N] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; fun( a, 2, 9 ); for ( i = 0; i < 5; i++ ) printf( "%d", a[i] ); return(0);}
A. 10234
B. 12344
C. 12334
D. 12234
查看答案
【单选题】下面程序执行后的输出结果是( )。#include void f( int a[], int i, int j ){ int t; if ( i < j ) { t = a[i]; a[i] = a[j]; a[j] = t; f( a, i + 1, j - 1 ); }}int main(){ int i, aa[5] = { 1, 2, 3, 4, 5 }; f( aa, 0, 4 ); for ( i = 0; i < 5; i++ ) printf( "%d", aa[i] ); return(0);}。
A. 54321
B. 52341
C. 12345
D. 12543
有以下程序段:int a[3][2] = { 1, 2, 3, 4, 5, 6, }, *p[3];p[0]= a[1];则*(p[0]+1)所代表的数组元素是( )。
A. a[0][1]
B. a[1][0]
C. a[1][1]
D. a[1][2]
下面程序段执行后的输出结果是( )。int a[] = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24 }, *q[4], k;for ( k = 0; k < 4; k++ )q[k] = &a[k * 3];printf( "%d", q[3][0] );
A. 8
B. 16
C. 20
D. 输出不合法
下面程序执行后的输出结果是( )。#include int main(){ int x[5] = { 2, 4, 6, 8, 10 }, *p, **pp; p = x, pp = &p; printf( "%d", *(p++) ); printf( "%3d", **pp ); return(0);}
A. 4 4
B. 2 4
C. 2 2
D. 4 6