首页 > 成人高考
题目内容 (请给出正确答案)
[主观题]

写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i

写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i

写出下列程序的运行结果。

#include void Fun(){int num=20;cout<< "The Fun's num is"<< num<< endl;

}void main(){int num=10;cout<< "The main's num is "<< num<< endl;Fun();{int num=30;

cout<< "The Field's num is "<< num<< endl;}cout<< "The main's num is "<< num<< endl;}

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“写出下列程序的运行结果。#include void Fun(…”相关的问题
第1题
下列程序的运行结果为【 】。 include <stdio.h> main() { static char str1[40];

下列程序的运行结果为【 】。 include <stdio.h> main() { static char str1[40]; char str2140]; strcpy(str2,"China"); strcat(str1,str2); strcat(str1," is a great country !"); printf("%s %s ",str2,strl); printf("%d %d\n",strlen(str2),strlen(str1)); }

点击查看答案
第2题
下列程序正确的运行结果为()#include<stdio.h>main(){int a[]={2,6,8,10,14,18);int *ptr[-]={&a[0],&a[1],&a[2],&a[3],&a[4]);int i;for(i=0;i<5;i++)a[i]=a[i]/2+a[i]printf("%d\n",*(*(ptr+2)));printf("%d\n",*(*ptr));}

A.1221

B.2112

C.123

D.312

点击查看答案
第3题
下面程序的运行结果()。 include<stdio.h> void main() { ifdef MYDEBUG int a=90;

下面程序的运行结果()。 include<stdio.h> void main() { ifdef MYDEBUG int a=90; printf("a=%d\n",a); else a+=10; printf("a=%d\n",a); endif )

A.a=90

B.a=100

C.a=190

D.程序不正确

点击查看答案
第4题
以下程序的运行结果为【 】。 include <stdio.h> main() { static int b[2][3]={{1,2,3},{4,

以下程序的运行结果为【 】。 include <stdio.h> main() { static int b[2][3]={{1,2,3},{4,5,6}}; static int *pb[]={b[0],b[1]}; int i,j; i=0; for (j=0;j<3;j++) printf("b[%d][%d]=%d ",i,j,*(pb[i]+j)); printf("\n"); }

点击查看答案
第5题
当输入1、3、2时,程序运行的结果为【 】。 include <math.h> main() { float a,b,c,disc,x1,x2,

当输入1、3、2时,程序运行的结果为【 】。 include <math.h> main() { float a,b,c,disc,x1,x2,p,q; do { scanf("%f,%f,%f",&a,&b,&c); disc=b*b-4*a*c; }while(disc<=0); p=-b/(2*a);q=sqrt(disc)/(2*a); x1=p+q;x2=p-q; printf("\nx1=%6.2f;x2=%6.2f\n",x1,x2); }

点击查看答案
第6题
若输入I have a test.,则以下程序的运行结果为【 】。 include<stdio.h> main() { FILE*fp;

若输入I have a test.,则以下程序的运行结果为【 】。 include<stdio.h> main() { FILE*fp; char str[100],filename[10]; int i=0; if ((fp=fopen("test","w"))==NULL) { printf("can not open the file!\n"); exit(0); } getchar(); gets(str); while(str[i]!=) { if (str[i]>=a && str[i]<=z) str[i]=str[i]-32; fputc(str[i],fp); i++; } fclose(fp); fp=fopen("test","r"); fgets(str,strlen(str)+1,fp); printf("%s\n",str); fclose(fp); }

点击查看答案
第7题
‍下面程序段运行的结果为()。‎#include‎int f();‎int f()‎{static int i=0;‎int s=1;s+=i;‎i++;‎ return s;}‎void main()‎{int i,a=0;‎for(i=0;i<5;i++)‎ a+=f();‎ printf("%d/n",a);}

A.25

B.15

C.20

D.24

点击查看答案
第8题
执行下面程序时,若从键盘输入“2”,则程序的运行结果是()#include若输入’d’或’D’的话,结果是什么?main(){intk;charcp;cp=getchar();if(cp>=’0’&&cp<='9’)k=cp-‘0’;elseif(cp>=‘a'&&cp<=‘f’)k=cp-‘a’+10;elsek=cp-‘A’+10;printf(“%d/n”,k);}

A.2

B.4

C.1

D.10

点击查看答案
第9题
写出程序运行结果。classPoint{intx,y;Point(intx,inty){this.x=x;this.y=y;System.out.println

写出程序运行结果。

classPoint{

intx,y;

Point(intx,inty){

this.x=x;

this.y=y;

System.out.println("父类构造函数被调用!");

}

}

classCircleextendsPoint{

intradius;

Circle(intr,intx,inty){

super(x,y);

this.radius=r;

System.out.println("子类构造函数被调用!");

}

}

publicclasstestInherence{

publicstaticvoidmain(Stringargs[]){

Circlec1=newCircle(2,2,2);

}

}

运行结果:

点击查看答案
第10题
#include"stdio.h"main(){inti,k=0,s[10]={1,2,3,4,5,6,7,8,9,10};for(i=0;i<10;i++)if(i%2)k+=s

#include"stdio.h"

main()

{inti,k=0,s[10]={1,2,3,4,5,6,7,8,9,10};

for(i=0;i<10;i++)

if(i%2)k+=s[i];

intfor(i=i-1;i>=0;i--)

if(i%5==0)printf("%d",s[i]);

printf("%d\n",k);

}

程序运行结果为:______

点击查看答案
第11题
下列程序的运行结果是______。 include<stdio.h> longfunc(int x) { long p; if

下列程序的运行结果是______。 include<stdio.h> longfunc(int x) { long p; if(x==0‖x==1) return(1) ; p=x*func(x-1) ; return(p); } main() { printf("%d\n",func(4) ); }

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改