网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
有以下程序: #include main() {  int x=1,y=2,z=3;  if(x>1)   if(y>x)putchar('A');   else putchar('B');  else   if(z
A

D

B

C

C

B

D

A


参考答案

参考解析
解析:
A项正确,main函数中,首先判断条件x>1,因为x=1,不满足条件,程序跳入else语句判定z<x是否成立,z=3,x=1,条件不成立,输出字母D。答案选择A选项。
更多 “单选题有以下程序: #include main() {  intx=1,y=2,z=3;  if(x1)   if(yx)putchar('A');   elseputchar('B');  else   if(z A DB CC BD A” 相关考题
考题 有以下程序#include stdio.hint 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)0B)9C)6D)8

考题 阅读下面程序,则在执行时候的输出为 【8】 。#include "stdio.h"main(){int x=1,y=2,z=0;if(x=2)z=x,x=y,y=z;printf("%d,%d\n",x,y);}

考题 有以下程序:includeint f(int x){int y;if(x==0||x==1)return(3);y=x*x-f(x-2);return 有以下程序: #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.0B.9C.6D.8

考题 有以下程序#include stdio.hint 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.0B.9C.6D.8

考题 以下程序段的运行结果是( )。 include main() {int x=2,y=1: switch(x) {case 1: switch 以下程序段的运行结果是( )。 include<stdio.h> main() {int x=2,y=1: switch(x) {case 1: switch(y) {case 0:printf("x=2,y=1\n");break; case 1:printf("y=1\n");break; } case 2:printf("x=2\n"); } }

考题 以下程序段的执行结果为 include define PLUS(X,Y)X+Y void main( ) { int x= 以下程序段的执行结果为 #include<iostream.h> #define PLUS(X,Y)X+Y void main( ) { int x=1,y=2,z=3,sum; sum=PLUS(x+y,z) * PLUS(y,z); cout < <"SUM=" < < sum; cout< <end1;}A.SUM=9B.SUM=12C.SUM=18D.SUM=30

考题 有以下程序:includefun(int a, int b){if(a>b) return(a); elsereturn(b);}main(){int 有以下程序: #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.3B.6C.8D.12

考题 若有以下程序段:include using namespace std;int main (){ int a[]={1,4,5}; int *p 若有以下程序段: #include <iostream> using namespace std; int main () { int a[]={1,4,5}; int *p=a[0],x=6, y,z; for (y=0; y<3; y++) z= ( (* (p+y) <x) ? *(p+y) :x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。A.1B.4C.5D.2

考题 以下程序执行后的输出结果是( )。include usingnamespacestd;void try(int,int,int,in 以下程序执行后的输出结果是( )。 #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.18B.9C.10D.不确定

考题 以下程序段的执行结果为【】。includedefine PLUS(x, y) x+ yvoid main() { int x=1, y 以下程序段的执行结果为【 】。include<iostream.h>define PLUS(x, y) x+ yvoid main(){int x=1, y=2,z=3,sum;sum=PLUS(x+ y, z)*PLUS(y, z);cout<<"SUM="<<sum;cout<<end1;}

考题 下面程序的结果【】。 include int f(int); void main() { int x=1,i; for (i=0; i 下面程序的结果【 】。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=3y++;z++;return (x+y+z);}

考题 有以下程序:include main() {int a[] = {2,4,6,8,10} ,y =0,x, * p;p =a[1];for( 有以下程序: #include <stdio.h> main() { int a[] = {2,4,6,8,10} ,y =0,x, * p; p =a[1]; for(x=1;x<3;x++)y+ =p[x]; printf( "% d \n" , y); }程序运行后的输出结果是( )。A.10B.11C.14D.15

考题 有以下程序:include void f(int v, int w){int t; t=v; v=w; w=t;}main(){int x=1,y=3 有以下程序: #include <stdio.h> void f(int v, int w) { int t; t=v; v=w; w=t; } main() { int x=1,y=3,z=2; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf("%d,%d,%d\n",x,y,z); } 执行后的输出结果( )。A.1,2,3B.3,1,2C.1,3,2D.2,3,1

考题 有以下程序 include main() { int a=1, b=2, c=3, x; x=(a^b)c; pri 有以下程序 #include <stdio.h> main() { int a=1, b=2, c=3, x; x=(a^b)c; printf("%d\n",x); } 程序的运行结果是A.0B.1C.2D.3

考题 有以下程序includeintf(intx){inty;if(x==0||x==1)return(3);y=x*x-f(x-2);returny;}m 有以下程序 #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.0B.9C.6D.8

考题 请选出以下程序的输出结果_______。includesub(x,y,z)int x,y,*z;{*z=y-x;}main(){int 请选出以下程序的输出结果_______。 #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,3B.-5,-12,-7C.-5,-12,-17D.5,-2,-7

考题 有以下程序 include mare() { int x=1,y=2,z=3; if(x>y) if 有以下程序 #include <stdio.h> mare() { int x=1,y=2,z=3; if(x>y) if(y<z) printf("%d",++z); else printf("%d",++y); printf("%d\n",x++); } 程序的运行结果是______。A.331B.41C.2D.1

考题 有下列程序: include int f(int x) { int y; if(x=0‖x==1)r 有下列程序: #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.0B.9C.6D.8

考题 有以下程序:includeint fun(int x,int y){if(x==y)return(x);else return((x+y)/2);}m 有以下程序: #include<stdio.h> int fun(int x,int y) {if(x==y)return(x); else return((x+y)/2); } main() {int a=1,b=2,c=3; printf("%d\n",fun(2*a,fun(b,C))); } 程序运行后的输出结果是( )。A.2B.3C.4D.5

考题 有以下程序:includemain(){int x=3,y=2,z=1; printf("%d\n",x/y~z);程序运行后的 有以下程序: #include <stdio.h> main() { int x=3,y=2,z=1; printf("%d\n",x/y~z); 程序运行后的输出结果是( )。A.3B.2C.1D.0

考题 以下程序执行后x的值是()。includemain(){int x,y=252,i=386,*m=y,*z=i;x=(z 以下程序执行后x的值是( )。 #include <stdio.h> main() { int x,y=252,i=386,*m=y,*z=i; x=(z= =m); printf("%d",x); }A.252B.1C.0D.运行时出错,x无定值

考题 有以下程序includeint f(intx){inty; if(x==0||x==1)return(3); y=x*x-f(x-2); return 有以下程序 #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.0B.9C.6D.8

考题 有以下程序:main ( ){ int X=3, y=2, z=1; printf ("%d\n", x/y~z );}A.3B.2C.1D.0

考题 有以下程序:includefun(int x,int y,int z){z=x*y;}main(){int a=4,b=2,c=6; fun(a,b, 有以下程序: #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.16B.6C.8D.12

考题 有以下程序:includemain(){int x=0,y=5,z=3; while(z-->0 ++x 有以下程序: #include <sldio.h> main() { int x=0,y=5,z=3; while(z-->0 ++x<5) y=y-1; printf("%d,%d,%d\n",x,y,z); } 程序执行后的输出结果是( )。A.3,2,0B.3,2,-1C.4,3,-1D.5,-2,-5

考题 如下程序的运行结果是______。 include main() { int x=y=3,z=1; printf ("%d%d\n",(++ 如下程序的运行结果是______。 #include<stdio.h> main() { int x=y=3,z=1; printf ("%d%d\n",(++x,y++),z+2); }A.3 4B.4 2C.4 3D.3 3

考题 单选题有以下程序:#include 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,z);}程序的运行结果是(  )。A 0B 9C 6D 8

考题 单选题有以下程序#include main(){ int x,y,z;  x=y=1;  z=x++,y++,++y; printf(%d,%d,%d,x,y,z);}程序运行后的输出结果是(  )。A 2,3,1B 2,3,2C 2,3,3D 2,2,1