8 12 56 4 6 55 15 33 62
12 56 4 6 55 15 33 62
#include<iostream>
using namespace std;
struct list
{
int i;
list *next;
};
int main()
{
list *head,*p;
int n;
cin>>n;
head=p=new list;
cin>>p->i;
n--;
while(n--)
{
p->next=new list;
p=p->next;
cin>>p->i;
}
p->next=NULL;
for(p=head;; p=p->next)
{
cout<<p->i<<" ";
if(p->next==NULL)
break;
}
return 0;
}
因篇幅问题不能全部显示,请点此查看更多更全内容