首页 > 月嫂/母婴护理师
题目内容 (请给出正确答案)
[主观题]

请读程序:# include<stdio.h>main(){floa x,y;scanf("%f",& x);if(x<0.0)y=0.0;else if ((x<

请读程序: # include<stdio.h> main() { floa x,y; scanf("%f",& x); if(x<0.0)y=0.0; else if ((x<5.0)& &(x!=2.0)) y=1.0/(x+2.0); else if(x<10.0)y=1.0/x; else y=10.0; printf("%f\n",y); } 若运行时从键盘上输入2.0<CR>(<CR>表示回车),则该程序的输出结果是()

A.0

B.0.25

C.0.5

D.1

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“请读程序:# include<stdio.h>main(){…”相关的问题
第1题
有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3;intt=0;if(n%2){ stat

有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3; int t=0; if(n%2){ static int a=4;t+ =a++;} else { static int a=5;t+ :a++;} return t + a + +;main (){ int s=a,i; for(i=0;i<3;i++)s + =f(i); prinff("% d \n" ,s); }程序运行后的输出结果是()。

A.26

B.28

C.29

D.24

点击查看答案
第2题
下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。#include "stdio

下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。

#include "stdio.h"

main()

{char c;

while((c=getchar())!='\n')

{if(c>='a'&&c<='z')

c=c-30;

if(c>'z'||c<='z'+2)

c=c-26;}

printf("%c",c);

}

错误:______

改正:______

参考答案:错误

点击查看答案
第3题
请读程序:# include<stdio.h>main(){int num=0;while(num<=2){num+ +;printf("%d\n",num);}}上面

请读程序: # include<stdio.h> main() {int num=0; while(num<=2) {num+ +;printf("%d\n",num);} } 上面程序的输出结果是 ()

A.1

B.1 2

C.1 2 3

D.1 2 3 4

点击查看答案
第4题
请读程序:#include<stdio.h>func(int a, int b){int c; c=a+b; return c;}main(){int x=6,y=7,z=

请读程序: #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

点击查看答案
第5题
有以下程序#include<stdio.h>#include<string.h>main(){char a[10]=”abcd”;prinff(“

有以下程序

#include<stdio.h>

#include<string.h>

main()

{char a[10]=”abcd”;

prinff(“%d,%d\n”,strlen(A),sizeof(A));

}

程序运行后的输出结果是

A.7,4

B.4,10

C.8,8

D.10,lO

点击查看答案
第6题
下面程序的运行结果是()。#include<stdio.h>#include<string.h>main(){char*s1="abDuj";char*s2="

下面程序的运行结果是()。 #include<stdio.h> #include<string.h> main() {char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }

A.正数

B.负数

C.零

D.不确定的值

点击查看答案
第7题
有以下程序#include<stdio.h>main(){int a=7; while(a--); printf("%d\n",a);}程序运行后

有以下程序

#include<stdio.h>

main()

{ int a=7;

while(a--);

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

}

程序运行后的输出结果是

A.-1

B.0

C.1

D.7

点击查看答案
第8题
有以下程序#include<stdio.h>#include<string.h>main(){char x[]=“STRING”;x[0]=0;

有以下程序

#include<stdio.h>

#include<string.h>

main()

{char x[]=“STRING”;

x[0]=0;x[1]=’\0’;x[2]=’0’;

printf(”%d%d\n”,sizeof(x),strlen(x));

}

程序运行后的输出结果是()。

A.6 1

B.7 0

C.6 3

D.7 1

点击查看答案
第9题
有以下程序:#include<stdio.h>#include<string.h>#includevoid f(char*s,char*t){char k;k=*s; *

有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是()。

A.abcdefg

B.gfedcba

C.gbcdefa

D.abedcfg

点击查看答案
第10题
以下程序:#include<stdio.h>#include<string.h>main(){char str[]="abcd\n\123\xab";printf("%d"

以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd\n\123\xab"; printf("%d",(str)); } 运行后的输出结果是()。

A.10

B.9

C.7

D.14

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