

以下是提交正确的代码:
int max_len( char *s[], int n )
{
	int i;
	int max=0;
 
	for(i=1;i<n;i++)
	{
		if(strlen(s[i])>strlen(s[max]))
		max=i;
		
	}
	return strlen(s[max]);
} 
以下是我自己写的代码:
出现的问题是 :括号加的不对,需要细心

int max_len( char *s[], int n )
{
   int i;
   int maxlen=strlen(s[0]);
   for(i=1;i<n;i++)
   {
   	  if(strlen(s[i])>maxlen)
   	  {
   	  	maxlen=strlen(s[i]);
	  }
	  
   }
   return maxlen;	
} 
 
单链表输入函数

第一种:
void input()
{
   while(1)
   {
   	struct stud_node*p=(struct stud_node*)malloc(sizeof(struct stud_node));
   	
   	scanf("%d%s%d",&p->num,p->name,&p->score);
   	
   	if(p->num==0)
   	break;
   	
   	
   	if(head==NULL)
   	{
   		head=tail=p;
	}
	else
	{
		tail->next=p;
		tail=p;
	}
   }
} 
第二种:
void input()
{
    struct stud_node *p;
    
    int x;
    scanf("%d",&x);
    while(x){
        p=(struct stud_node*)malloc(sizeof(struct stud_node));
        p->num=x;
        scanf("%s %d",p->name,&p->score);
       p->next=NULL;
        if(head==NULL)head=p;
        else tail->next=p;
        tail=p;
        scanf("%d",&x);
    }
} 
                


















