下面程序的运行结果是________。#includeint a[3] ;int main( ){void f1( ) ;void f2( ) ;void print( ) ;f1( ) ;print( ) ;f2( ) ;print( ) ;return 0 ;}void f1( ){int i ;for ( i = 0 ; i < 3 ; i++ )a[i] = i ;}void f2( ){int i ,a[3] ;for ( i = 0 ; i < 3 ; i++ )a[i] = i +3;}void print( ){int i ;for ( i = 0 ; i < 3 ; i++ )printf( "%3d" , a[i] ) ;}
查看答案
有以下程序:#include void fun(int a[ ], int n){int i, t;for (i = 0; i < n / 2; i++){ t = a[i] ; a[i] = a[n - 1 - i] ; a[n - 1 - i] = t ;}}main( ){int k[10] = {1,2,3,4,5,6,7,8,9,10}, i ;fun(k, 5) ;for (i = 2; i < 8; i++)printf("%d", k[i]) ;printf("\n") ;}程序的运行结果是____________。
有以下程序:#include void fun2(char a, char b){printf("%c%c", a, b);}char a = 'A', b = 'B';void fun1(){a = 'C'; b = 'D';}main( ){fun1( );printf("%c%c", a, b);fun2('E', 'F');}
下面程序的功能是:area函数计算圆的面积,main函数中调用area函数,计算给定半径的圆的面积,输出时显示两位小数。请填空。#include#define PI 3.14int main( ){________;float x = 2.4 , y ;y = area( x ) ;printf( "%6.2f\n" , y ) ;return 0 ;}float area ( float r ){float s ;s= PI * r * r ;________;}
下面程序的功能:有一个一维数组score,内放10个学生成绩,统计不及格的学生人数。请填空。#include int main( ){int fun( float array[10] ) ;float score[10] ;int i , count = 0 ;printf( "input 10 scores:\n" ) ;for( i = 0 ; i < 10 ; i++ )scanf( "%f" , &score[i] );________;printf( "%d\n" , count ) ;return 0 ;}int fun( float array[10] ){int i , count = 0 ;for( i = 0 ; i < 10 ; i++ )if( array[i] <60 )________;return count ;}