重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 成人高考
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[主观题]

写出下列程序的运行结果。#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;}

答案
查看答案
更多“写出下列程序的运行结果。#include void Fun(){int num=20;cout&lt;&lt; "The Fun's num i”相关的问题

第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) ); }

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝