请补充main函数,该函数的功能是:从键盘输入一组字符串,以’*’结束输入,并显示出这个字符串。
例如,输入abcdef *, 结果显示abcdef。
仅在横线上添入所编写的若干表达式或语句,勿改动函数中的其他任何内容。
#include
#define N 80
main()
{
int i = -1, j = 0;
char str[N];
printf("\n Input a string \n");
do
{
i++;
scanf(_1_);
} while (_2_);
printf("\n ******* display the string ******* \n");
while (j < i)
{
printf(_3_);
j++;
}
}
答案: (1)“%c”,&str[i]
(2)str[i]!=’*’
(3)”%c”,str[j]
编辑特别推荐: