| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
这个程序有什么问题,在List * creatlist(int n)这行有 错#include<iostream.h>
#include<stdio.h>
class List
{
int data;
int *next;
}
list * creatlist(int n)
{ int n;
List *p,*r,*list=NULL;
int e;
for(int i=0;i<n;i++)
{cin>>e;
p=(List*)malloc(sizeof(List));
p->data=e;
p->next=NULL;
if(!list)
list=p;
else r->next=p;
r=p;
}
return list
}
void main()
{
int n;
cin>>n;
cout<<creatlist(n)<<endl;
int *pt=creatlist(n);
for (int i1=0;i1<n;i1++)
cout<<pt;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator