**输入提示信息:"Input a string:"
**输入格式要求:"%s"
**输出格式要求:"Insert result:%s\n"
参考答案
#include <stdio.h>
#include <string.h>
#define N 100
void Insert(char s[]);
int main()
{
char str[N];
printf("Input a string:");
gets(str);
Insert(str);
printf("Insert result:%s\n",str);
return 0;
}
void Insert(char s[])
{
char t[N];
int i,j;
strcpy(t,s);
for(i=0,j=0;t[i]!='\0';i++,j++)
{
s[j] = t[i];
j++;
s[j] = ' ';
}
s[j] = '\0';
}