下列给定程序中,函数fun的功能是:将P所指字符串中的所有字符复制到b中,要求每复制

题型:问答题

问题:

下列给定程序中,函数fun的功能是:将P所指字符串中的所有字符复制到b中,要求每复制3个字符之后插入一个空格。
例如,若给a输入字符串:“ABCDEFGHIJK”,调用函数后,字符数组b中的内容为:“ABC DEFGHI JK”。
请改正程序中的错误,使它能得出正确结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
试题程序:
#include<stdio.h>
void fun(char*p,char*b)
(int i,k=0;
while(*p)
i=1;
while(i<=3&&*p)
/********found********/
b[k]=p;
k++;p++;1++;

if(*p)

/********found********/
b[k++]=…"";

b[k]=’\0’;)
main()
(char a[80],b[80];
printf("Enter a string:");
gets(a);
printf("The original string:");
puts(a);
fun(a,b);
printf("\nThe string after insert space:");
puts(b);printf("\n");

考点:计算机等级考试C语言二级C语言机试
题型:问答题

高锰酸钾俗称灰锰氧,其水溶液是常用的消毒剂.高锰酸钾的物质类别属于(  )

A.酸

B.碱

C.盐

D.氧化物

题型:问答题

用复合物体中的布尔运算操作时,差集(A-B)的运算方式是()

A、相加

B、相交

C、A物体被B物体减去

D、B物体被A物体减去

题型:问答题

控制反常呼吸运动的措施是

A.气管切开
B.给氧
C.用厚敷料和胸带加压包扎软化区
D.胸膜腔穿刺排气减压
E.止痛

题型:问答题

《用电客户电费回收预警管理暂行办法》对电费评定周期是如何规定的?

题型:问答题

If you are loading fruit in reefer spaces and you notice that the fruit is beginning to mold, you should().

A.carry the cargo at a cooler temperature than originally planned

B.write up exception on the cargo

C.refuse to carry the cargo

D.discharge CO2 into the compartment after loading

更多题库