填空题
【填空题】写出下面程序执行后的运行结果____。#include void swap1( int c0[], int c1[] ){ int t; t = c0[0]; c0[0] = c1[0]; c1[0] = t;} void swap2( int *c0, int *c1 ){ int t; t = *c0; *c0 = *c1; *c1 = t;} int main(){ int a[2] = { 3, 5 }, b[2] = { 3, 5 }; swap1( a, a + 1 ); swap2( &b[0], &b[1] ); printf( "%d %d %d %d", a[0], a[1], b[0], b[1] ); return(0);}
填空题
【填空题】写出下面程序执行后的运行结果____。#include int f1( int x, int y ){ return(x > y ? x : y);} int f2( int x, int y ){ return(x > y ? y : x);} int main(){ int a = 4, b = 3, c = 5, d = 2, e, f, g; e = f2( f1( a, b ), f1( c, d ) ); f = f1( f2( a, b ), f2( c, d ) ); g = a + b + c + d - e - f; printf( "%d,%d,%d", e, f, g ); return(0);}
填空题
【填空题】写出下面程序执行后的运行结果____。#include void fun( int *a, int i, int j ){ int t; if ( i < j ) { t = a[i]; a[i] = a[j]; a[j] = t; i++; j--; fun( a, i, j ); }} int main(){ int x[] = { 2, 6, 1, 8 }, i; fun( x, 0, 3 ); for ( i = 0; i < 4; i++ ) printf( "%d", x[i] );return(0);}
套餐购买该问题答案仅对会员开放,欢迎开通会员 ¥ 19.9
0.64/天
1个月(不限次)
¥ 19.9
1000次
(不限时)
¥ 29.9
0.32/天
3个月(不限次)
¥ 59.9
0.16/天
1年(不限次)
立即支付