阅读以下程序,当输入数据的形式为25,13,10<CR>正确的输出结果为: #include<stdio.h> int main() { int x,y,z scanf("%d%d%d",&x,&y,&z ); printf("x+y+z=%dn ,x+y+z); return 0; }
A.x +y+z=48
B.x +y+z=35
C.x +z=35
D.不确定值
第1题:
有以下程序
#include <stdio.h>
int f(int x)
{ int y;
if(x==0||x==1) return(3);
y=x*x-f(x-2);
return y;
}
main()
{ int z;
z=f(3); printf("%d\n",z);
}
程序的运行结果是
A.0
B.9
C.6
D.8
第2题:
以下程序执行后的输出结果是( )。 #include <iostream> using namespace std; void try(int,int,int,int); int main ( ) { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = X*X; y = y*y; r = z+x+y; }
A.18
B.9
C.10
D.不确定
第3题:
有如下程序: #include <stdio.h> int func(int a,int b) { return(a+b):} main() { int x=2,y=5,z=8,r; r=func(func(x,y),z); printf("%d\n",r); } 该程序的输出结果是( )。
A.12
B.13
C.14
D.15
第4题:
有以下程序 #include <stdio.h> intf(int x) { int y; if(x==0||x==1) return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3); printf("%d\n",z); } 程序的运行结果是
A.0
B.9
C.6
D.8
第5题:
阅读程序段,当输入数据形式为25,13,10时,正确的输出结果为 ______。 int x, y, z; cin>>x>>y>>z;; cout<< "x+y+z=%d\n" <<x+y+z;
A.x+y+z=48
B.x+y+z=35
C.x+z=35
D.不确定值
第6题:
有下列程序: #include <stdio.h> int f(int x) { int y; if(x=0‖x==1)return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3);printf("%d\n",z); 程序的运行结果是( )。
A.0
B.9
C.6
D.8
第7题:
若执行下述程序时,从键盘输入的数据是3和6,则程序的输出结果是( )。 #include <stdio.h> void main() {int x,y,z; scanf("%d%d",&X,&y); z = y + x; if (x<y) z = y + x; printf("%d",z); }
A.9
B.3
C.0
D.有语法错误
第8题:
有以下程序 #include <stdio.h> int f(int x) { int y; if(x==0||x==1) return(3); y=x*x-f(x-2); return y; } main() { int z; z=f(3); printf("%d\n",z); } 程序的运行结果是
A.0
B.9
C.6
D.8
第9题:
请读程序: #include<stdio.h> func(int a,int b) { int c; c=a+b; return c; } main(){ int x=6,y=7,z=8,r, r=func((x-,y++,x+y),z-); printf("%d\n",r); } 上面程序的输出结果是_______。
A.11
B.20
C.21
D.31
第10题:
以下程序执行后的输出结果是 #include<iostream> using namcspace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }
A.18
B.9
C.10
D.不确定
第11题:
有以下程序: #include <stdio.h> fun(int x,int y,int z) { z=x*y;} main() { int a=4,b=2,c=6; fun(a,b,c); printf("%d",c); } 程序运行后的输出结果是( )。
A.16
B.6
C.8
D.12
第12题:
以下程序输出的结果是( )。 #include<iostream> using namespace std; int main() { int **x,*y,z=10; y=&z; x=&y; cout<< **x+1<<endl; return 0; }
A.11
B.x的地址
C.y的地址
D.运行错误
第13题:
有以下程序: #include <stdio.h> fun(int a, int b) { if(a>b) return(a); else return(b); } main() { int x=3,y=8,z=6,r; r=fun(fun(x,y),2*z); printf("%d\n",r); } 程序运行后的输出结果是( )。
A.3
B.6
C.8
D.12
第14题:
下面程序的结果【 】。
include<iostream.h>
int f(int);
void main() {
int x=1, i;
for (i=0; i<3; i++)
cout<<f(x)<<‘ ’ ;
cout<<end1;
}
int f(int x){
int y=1;
static int z=3
y++;
z++;
return (x+y+z);
}
第15题:
main() { int x,y,z; scanf (“%d%d%d”,&x,&y,&z); printf(“x+y+z=%d\n”,x+y+z); } 输入数据的形式是25,13,10<回车>,则程序的输出结果是( )
A. x+y+z=48
B. x+y+z=35
C. x+z=35
D. 不确定值
第16题:
以下程序运行时若要正确输出函数的入口地址和输入数的绝对值,应在程序空缺处填入的正确选项是 ( )。 abs(int x) { if(x>=0)return x: else return -x;} main() { int y,z,(*p)(int x)=abs; scanf(" %d" ,&y); z=(*p)(y); ______;}
A.printf(" %d%d\n" ,&p,z)
B.printf(" %d%d\n" ,p,z)
C.printf(" %d%d\n" ,*p,z)
D.Printf(" %d%d\n" ,p,*z)
第17题:
请选出以下程序的输出结果_______。 #include<stdio.h> sub(x,y,z) int x,y,*z; {*z=y-x;} main(){ int a,b,c; sub(10,5,&A) ;sub(7,a,&B) ;sub(a,b,&C) ; printf("%d,%d,%d\n",a,b,C) ; }
A.5,2,3
B.-5,-12,-7
C.-5,-12,-17
D.5,-2,-7
第18题:
关于下面的程序 #include<stdio.h> main() { int x=3,y=0,z=0; if(x=y+z)printf("****"); else printf("$$$$"); }说法正确的是______。
A.有语法错误不能通过编译
B.输出****
C.输出$$$$
D.可以通过编译,但不能通过连接,无法运行
第19题:
有以下程序: #include <stdio.h> main() { int x=3,y=2,z=1; printf("%d\n",x/y&~z); 程序运行后的输出结果是( )。
A.3
B.2
C.1
D.0
第20题:
下面程序的输出结果是( )。 #include "stdio.h" fun (x int x { int y=0; static int z=5; z=x++,y++; return(Z); } main() { int a=4,i,j; for(i=0;i<2;i++) j=fun(a++); printf("%d",j); }
A.0
B.3
C.4
D.5
第21题:
以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }
A.18
B.9
C.10
D.不确定
第22题:
请读程序: #include <stdio.h> func(int a, int b) { int c; c=a+b; return c; } main() { int x=6,y=7,z=8,r; r=func((x--,y++,x+y),z--); printf("%d\n",r); 上面程序的输出结果是( )。
A.11
B.20
C.21
D.31
第23题:
以下程序执行后的输出结果是 #include<iostream>. using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }
A.18
B.9
C.10
D.不确定
第24题:
0
9
6
8