填空题
1. 请补充main()函数,该函数的功能是:把字符串str1中的非空格字符复制到字符串str2中。
例如,若str1="nice to meet you!",则str2="nicetomeetyou!"。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在main()函数的横线上填入所编写的若干表达式或语句。
试题程序: #include <stdlib.h>
#include <stdio.h>
#define M 80
void main()
{
static char str1 [M]="nice to meet you!";
char str2[M];
int i=0, j=0;
system ("CLS");
printf("<n****str1****<n");
puts(str1);
while(str1[i])
{
if (______)
str2[j++]=strl[i];
______;
}
printf("<n****str2****<n");
for(i=0;i<j;i++)
printf("%c",str2[i]);
}