1.用gets()直接读入.
2.用scanf("%[^\n]",essay);(essay为字符数组名称);
#include<stdio.h>
#include<string.h>
int main()
{
char name[1000];
memset(name,NULL,sizeof(name));
scanf("%[^\n]",name);
printf("%s\n",name);
return 0;
}
1.用gets()直接读入.
2.用scanf("%[^\n]",essay);(essay为字符数组名称);
#include<stdio.h>
#include<string.h>
int main()
{
char name[1000];
memset(name,NULL,sizeof(name));
scanf("%[^\n]",name);
printf("%s\n",name);
return 0;
}