【填空题】写出下面程序执行后的运行结果____。#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 SUM( int n ){ if ( n == 1 ) return(1); else return(n * n + SUM( n - 1 ) );} int main(){ printf( "SUM=%d", SUM( 5 ) ); return(0);}
【填空题】函数fun的功能是计算xn double fun( double x, int n ){ int i; double y = 1; for ( i = 1; i <= n; i++ ) y = y * x; return(y);}主函数中已经正确定义m,a,b变量并赋值,调用fun函数计算:m=a4+b4-(a+b)3的调用语句为、____
【填空题】写出下面程序执行后的运行结果____。#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);}