计算机等级考试模拟试题汇总
文章作者 100test 发表时间 2007:05:15 11:27:40
来源 100Test.Com百考试题网
模拟试题(一)
1.填空题
请补充函数fun(),该函数的功能是:把从主函数中输入的字符串str2接在字符串str1的后面。
例如:str1=“How do”,str2=“ you do?”,结果输出:How do you do?
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。
试题程序:
#include
#include
#define N 40
void fun(char *str1,char *str2)
{
int i=0.
char *p1=str1.
char *p2=str2.
while(【1】)
i .
for( .【2】.i )
*(p1 i)=【3】.
*(p1 i)= \0 .
}
main()
{
char str1[N],str2[N].
clrscr().
printf("*****Input the string str1