我想找出链表中的最大值并返回,求大神帮我修改
struct slist
{ double s;
struct slist *next;
};
typedef struct slist STREC;
double fun( STREC *h )
{
double *a;
a=h;
while(h!=NULL)
{
if(a<(h->next)) a=h->next;
h=h->next;
}
return *a;
}
struct slist
{ double s;
struct slist *next;
};
typedef struct slist STREC;
double fun( STREC *h )
{
double *a;
a=h;
while(h!=NULL)
{
if(a<(h->next)) a=h->next;
h=h->next;
}
return *a;
}
2018-01-04
举报