首页 > 建设工程> 注册土木工程师
题目内容 (请给出正确答案)
[主观题]

有以下程序#include<stdio.h>#include<string.h>main(){char str[][20]={“Qne*World

有以下程序

#include<stdio.h>

#include<string.h>

main()

{char str[][20]={“Qne*World”,“one*Dream!”},*P=str[1 ].

prinff(“%d,”,strlen(p));printf(“%s\n”,P); ’

}

程序运行后的输出结果是

A.9,One*World S)

B.9,One*Dream!

C.10,One*Dream!

D.10,One*World

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序#include<stdio.h>#include…”相关的问题
第1题
以下程序打开新文件f.txt,并调用字符输出函数将a数组中的字符写入其中,请填空。include<stdio.

以下程序打开新文件f.txt,并调用字符输出函数将a数组中的字符写入其中,请填空。

include<stdio.h>

main()

{________*fp;

char a[5]=(’1’,’2’,’3’,’4’,’5’),i;

fp=fopen(”f.txt”,”w”);

for(i=0;i<5;i++)fputc(a[i],fp);

fclose(fp);

}

点击查看答案
第2题
请编写函数fun(),该函数的功能是:计算并输出 S=1+(1+20.5)+(1+20.5+30.5)+…+(1+20.5+30.5+…+n0.5

请编写函数fun(),该函数的功能是:计算并输出

S=1+(1+20.5)+(1+20.5+30.5)+…+(1+20.5+30.5+…+n0.5)

例如,若主函数从键盘给n输入20后,则输出为

s=534.188884。

注意;部分源程序给出如下。

请勿改动主函数main 和其他函数中的任何内容,仅在函数fun 的花括号中填入所编写的若干语句。

试题程序:

include <math. h>

include <stdio. h>

double fun(int n)

{

}

main()

{

int n;

double s;

printf("\n\nInput n: ");

scanf ("%d", &n);

s=fun (n)

printf ("\n\ns=%f\n\n", s);

}

点击查看答案
第3题
请编写函数fun(),该函数的功能是:移动字符串中的内容,移动的规则是把第1到第m个字符,平移到字符

请编写函数fun(),该函数的功能是:移动字符串中的内容,移动的规则是把第1到第m个字符,平移到字符串的最后,把第m+1到最后的字符移到字符串的前部。

例如,字符串中原有的内容为ABCDEFGHIJK,m的值为 3,移动后,字符串中的内容应该是DEFGHIJKABC。

注意:部分源程序给出如下。

请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。

试题程序:

include <stdio. h>

include <string.h>

define N 80

void fun (char *w, int m)

{

}

main ()

{

char a[N]= "ABCDEFGHIJK";

int m;

printf ("The origina string : \n");

puts (a);

printf("\n\nEnter m: ");

scanf ("%d", &m);

fun (a, m);

printf (" \nThe string after moving : \n");

puts (a);

printf ("\n\n");

}

点击查看答案
第4题
有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a;

有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a; else return(fun(-a,-b)); } main() { printf("%d\n",fun(4,2)); } 程序的运行结果是______。

A.1

B.2

C.3

D.4

点击查看答案
第5题
有以下程序: #include<stdio.b> void fun(char c) { if(c>X)fun(c-1): printf("%C"

有以下程序: #include<stdio.b> void fun(char c) { if(c>X)fun(c-1): printf("%C",c); } traia() { fun(z);} 程序运行后的输出结果是()

A.xyz

B.wxyz

C.xzy

D.zvx

点击查看答案
第6题
有以下程序: include<stclio.h> main() { char c; while((c=getchar())!=?)pu

有以下程序: include<stclio.h> main() { char c; while((c=getchar())!=?)putchar(--c); } 程序运行时,如果从键盘输入:Y?N?<回车>,则输出结果为【 】。

点击查看答案
第7题
有以下程序 #include <stdio.h>main(){ char a,b,c;b=’1’; c=’A’; for(a=0; a<6; a++)

有以下程序

#include <stdio.h>

main()

{ char a,b,c;

b=’1’; c=’A’;

for(a=0; a<6; a++)

{ if (a%2) putchar(b+a);

else putchar(c+a);

}

}

程序运行后的输出结果是

A) 1B3D5F

B) ABCDEF

C) A2C4E6

D) 123456

点击查看答案
第8题
有以下程序#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

点击查看答案
第9题
有以下程序:#include<stdio.h>main(){int a [10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3], *q=p+2;

有以下程序: #include <stdio.h> main() { int a [10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3], *q=p+2; prinff("%d\n";*p+*q); } 程序运行后的输出结果是()。

A.16

B.10

C.8

D.6

点击查看答案
第10题
有以下程序: #include<stdio.h> void func(int n) { int i; for(i=0;i<=n;i++)prin

有以下程序: #include<stdio.h> void func(int n) { int i; for(i=0;i<=n;i++)printf("*"): printf("#"); } main() {func(3);printf("????");func(4);printf("n\"); 程序运行后的输出结果()。

A.****#????***#

B.***#????****#

C.**#????****#

D.****#????*****#

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