单项选择题

有以下程序:
#include <stdio.h>
int fun(int n)
if(n == 1) return 1;
else return( n + fun( n - 1 ) );main( )
int x;
seanf("% d" ,&X) ;x = fun(x) ;pfinff( "% d \n" ,x); 执行程序时,给变量x输入10,程序的输出结果是( )。

A.55
B.54
C.65
D.45
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include <stdio.h> int fun(int x[], int n) static int sum =0,i; for(i=0;i<n;i ++ )sum + =x[i]; return sum; int a[] =1,2,3,4,5,b[]=6,7,8,9,s=0; s = fun(a,5) + fun(b,4) ;printf( %d n ,s);程序执行后的输出结果是( )。
A.45
B.50
C.60
D.55
单项选择题
有以下程序: #include <stdio.h> main( ) ehar c1,c2,c3,c4,c5,c6; scanf( % c% c% c% c , &c1, &c2, &c3, &c4); c5 = getehar( ); c6 = getchar( ); putehar(c1); putehar(c2); printf( %c%c n , c5, c6); 23 <回车> 45678 <回车>
A.1267
B.1256
C.1278
D.1245
相关试题
  • 以下程序中函数fun()的功能是构成一个如...
  • 当运行以下程序时,输入abcd,程序的输出结...
  • 以下程序用于判断a,b,c能否构成三角形,...
  • 以下程序的功能是:输出100以内(不含1...
  • 若变量a,b已定义为int类型并分别赋值21...