主观

请编写函数proc,该函数的功能是:将放在字符串数组中的M个字符串(每串的长度不超过N),按顺序合并组成一个新的字符串。

例如,若字符串数组中的M个字符串为:

ABCD

BCDEFG

CDEFGHI

则合并后的字符串内容应该是ABCDBCDEFGCDEF—GHl。

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

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

试题程序:

#include

#include

#define M 3

#define N 20

void proc(char arr[M][N],char*b)

{

}

void main

{

char str[M][N]={"ABCD","BCDEFG","

CDEFGHI"},i;

char arr[100]={"#############

#####");

printf("The string:\n");

for(i=0;i

puts(str[i]);

printf("\n");

proc(str,arr);

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

printf("%s",arr);

printf("\n\n");

}

参考答案
您可能感兴趣的试题

对下述程序的判断中,正确的是( )。

#include

main( )

{ char*p,s[256];

p=s ;

while(strcmp(s,"the end"))

{ printf("Input the strin9:"); 

gets(s);

while(*p)

putchar(*p++);

}}

  • A.此程序循环接收字符串并输出,直到接收到字符串“the end”为止
  • B.此程序循环接收字符串,接收到字符串“the end”则输出,否则程序终止
  • C.此程序循环接收字符串并输出,直到接收字符串“the end”为止,但因为代码有错误,程序不能正常工作
  • D.此程序循环接收字符串并将其连接在一起,直到接收字符串“the end”为止,输出连接在一起的字符串

下列程序的执行结果是( )。

#include

main

{ int a,b,c;

  • a=b=2,c=I;
  • c=(a++)-1;printf("%d,0Ad",a,c);
  • c+=-a+++(++b);printf("%d,%d",a,c);    )
  • A.3,14,1
  • B.3,14,2
  • C.2,04,1
  • D.2,14,1

关系数据库管理系统能实现的专门关系运算包括(  )。

  • A.排序、索引、统计
  • B.选择、投影、连接
  • C.关联、更新、排序
  • D.显示、打印、制表
¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服