【单选题】【消耗次数:1】
下面程序的输出是 int fun3(int x) {static int a=3; a+=x; return(a); } void main() {int k=2,m=1,n; n=fun3(k); n=fun3(m); printf(%d\n }
3
4
6
9
参考答案:
复制
纠错
相关题目
【单选题】 有以下程序,程序执行后的输出结果是( ) #include int fun(int x [ ],int n) { static int sum=0,i; for(i=0; i{ sum+=x[i]; } return sum; } void main( ) { int a[ ]={1,2,3,4,5}; int b[ ]={6,7,8,9},s=0; s=fun(a,5)+fun(b,4); printf(%d\n,s); }
①  45
②  50
③  60
④  66
【单选题】 以下程序的运行结果是( )。 void fun(int array[3][3]) { int j; for(j=0;jj++) array[1][j]=array[1][j]++; printf(\n} void main(){ int j,a[3][3]={0,1,2,1,0,4,2,4,5};fun(a);for(j=0;jj++)printf(%d,a[1][j]); printf(\n }
①  1 0 4
②  2 1 5
③  0 1 2
④  1 2 3
【单选题】 以下程序的输出结果是_______? f(int b[],int m,int n) { int i,s=0; for(i=m;in;i=i+2) s=s+b[i]; return s; } int main() { int x,a[]={1,2,3,4,5,6,7,8,9}; x=f(a,3,7); printf(%d\n,x); }
①  7
②  8
③  9
④  10
【单选题】 下列程序的输出结果是()。 #include fun(int *a,int *b) {int *w;*a=*a+*a;*w=*a; *a=*b; *b=*w;} main( ) {int x=9,y=5,*px=fun(px,py);printf(%d, %d\n,x,y);}
①  出错
②  18,5
③  5,9
④  5,18
【单选题】 以下程序的输出结果是() int a, b; void fun( ) { a=100; b=200; } main( ) { int a=100, b=100; fun( ); printf(%d%d \n, a,b); }
①  100200
②  100100
③  200100
④  200200
【单选题】 以下程序的运行结果是( )。 Main() {int k=4,a=3,b=2,c=; printf(\n %d\n,ka?k:cb?c:a); }
①  4
②  3
③  2
④  1
【单选题】 有以下程序,执行后输出结果是() main( ) { int m[][3]={1,4,7,2,5,8,3,6,9}; int i,j,k=2; for(i=0;i { printf(%d ,m[k][i]); } }
①  4 5 6
②  2 5 8
③  3 6 9
④  7 8 9
【单选题】 以下程序运行后输出结果是()。#includestdio.hintfun(inta,intb){return(a-b);}main(){intx=5,y=3,k;k=fun(x,y);printf("%d-%d=%d\n",x,y,k);}
①  0
②  x-y=2
③  5-3=2
④  2
【单选题】 有说明语句int a[10];及函数int fun(int x[10],int n){return sizeof(x);},则语句cout<<fun(a,10)<<endl;的显示结果是()
①  40
②  10
③  4
④  0
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=1,b=2,c=3; if(c=a)printf(%d\n else printf(%d\n }
①  1
②  3
③  5
④  6
随机题目
【判断题】 Rio de Janeiro is the capital city of Spain.
①  正确
②  错误
【单选题】 I’m looking forward ( ) this visit.
①  to
②  in
③  at
④  by
【单选题】 People go to sail and swim in the sea, and( ) in the hills and mountains that overlook the city.
①  walked
②  walks
③  walking
④  to walk
【单选题】 when will the car stop ( )
①  run
②  ran
③  running
④  runing
【单选题】 I haven’t made ( ) my mind where to go.
①  up
②  from
③  out
④  in
【单选题】 I like the freedom of deciding where ( ) ,what to do and how long to stay.
①  goes
②  be going
③  to go
④  go
【单选题】 I’d like ( ) one of your boats
①  to rent
②  rent
③  renting
④  rented
【单选题】 how long can I stay in the mountain ? ( ) you like.
①  As far as
②  As well as
③  As soon as
④  As long as
【单选题】 which the following choice is wrong about the meaning of tourism ?
①  旅游
②  旅游业
③  旅游者
④  旅行
【单选题】 Not necessary ( )under 1.1meters
①  when
②  how
③  if
④  that