主题:急!!!大家看看错在哪啊
#include<iostream.h>
typedef struct node
{
char data;
struct node *next;
}LNode,*LinkList;
LinkList CreateFromHead()
{
LinkList L,r;
LNode *s;
char c;
int flag=1;
L=new(LNode);
L->next=NULL;
r=L;
while(flag)
{
cin>>c;
if(c!='$')
{
s=new(LNode);
s->data=c;
r->next=s;
r=s;
}
else
{
flag=0;
r->next=NULL;
}
}
return L;
}
void main()
{
LinkList L;
L=CreateFromHead();
LinkList pre,p;
pre=L;p=pre->next;
int max;
max=p->data;
while(p->next!=NULL)
{
p=p->next;
if(p->data>max)
max=p->data;
}
cout<<max;
}
typedef struct node
{
char data;
struct node *next;
}LNode,*LinkList;
LinkList CreateFromHead()
{
LinkList L,r;
LNode *s;
char c;
int flag=1;
L=new(LNode);
L->next=NULL;
r=L;
while(flag)
{
cin>>c;
if(c!='$')
{
s=new(LNode);
s->data=c;
r->next=s;
r=s;
}
else
{
flag=0;
r->next=NULL;
}
}
return L;
}
void main()
{
LinkList L;
L=CreateFromHead();
LinkList pre,p;
pre=L;p=pre->next;
int max;
max=p->data;
while(p->next!=NULL)
{
p=p->next;
if(p->data>max)
max=p->data;
}
cout<<max;
}