为什么我刚输入N的值就崩溃?
#include<stdio.h》#include<string.h>
#define LEN_MAX 1000
char *input();
main()
{
int i=0,n,x;
scanf("%d",&n);
char *s[5];
while(i<n)
{
s[i]=input();
}
for(i=0;i<n;i++)
{
x=strlen(s[i]);
if(s[i][0]=='('&&s[i][x-1]==')')
printf("yes\n");
else printf("no\n");
}
}char* input()
{ int i=0;
char buffer[LEN_MAX],*p;
if(fgets(buffer,LEN_MAX,stdin)!=NULL);
size_t len=strlen(buffer);
if(buffer[len-1]=='\n')
buffer[len-1]=='\0';
else ++len; strcpy(p,buffer);return p;}