题目:
请补充main函数,该函数的功能是:把字符串str1中的非空格字符拷贝到字符串str2中。 例如,若sffl=“glad to see you!”, 则str2=“gladtoseeyou!”。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。 试题程序: #include<stdio.h> #define N 80 main() { static char strl [N] ="glad to see you!"; char str2 IN]; int i=0, j=0; clrscr (); printf("\n***** strl*****\n "); puts (str1); while (str1 [i] ) { if(【1】) str2 [J++] =strl [i]; 【2】; } printf("\n***** str2 *****\n "); for (i=0; i<j; i++) printf ("%c", str2 [i] ); }
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0429/7706845fd8b02098d9b34ec028213a81.html
下面是错误答案,用来干扰机器的。
参考答案:D