#2
qunxingw2013-09-30 09:17
|
程序代码:
#include <iostream>
using namespace std;
typedef struct link
{
int data;
link *next;
}llist;
llist *head()
{
llist *r,*s,*head;
head = new link;
r = new link;
s = new link;
int x;
head->next = r;
cout << "please input something:";
cin >> x;
while(x!=0)
{
r->data = x;
r->next = s;
r=s;
}
r->next = NULL ;
return head;
}
using namespace std;
typedef struct link
{
int data;
link *next;
}llist;
llist *head()
{
llist *r,*s,*head;
head = new link;
r = new link;
s = new link;
int x;
head->next = r;
cout << "please input something:";
cin >> x;
while(x!=0)
{
r->data = x;
r->next = s;
r=s;
}
r->next = NULL ;
return head;
}
[ 本帖最后由 Onesaber 于 2013-9-29 23:38 编辑 ]