#include<stdio.h>
#include<stdlib.h>
#include<iostream>s
#define maxlen 10000
using namespace std;
typedef struct
{
int data[maxlen];
int len;
}Seqlist;
void creatlist(Seqlist *L,int n)
{
int i;
for(i=0;i<n;i++)
{
cin>>L->data[i];
}
L->len=n;
}
void putlist(Seqlist *L)
{
int i;
for(i=0;i<L->len;i++)
{
cout<<L->data[i]<<" ";
}
cout<<endl;
}
int main()
{
Seqlist *L=(Seqlist *)malloc(sizeof(Seqlist));
int n;
cout<<"请输入您要创建的顺序表的长度;\n"<<endl;
cin>>n;
cout<<"请输入您要创建的顺序表;\n"<<endl;
creatlist(L,n);
cout<<"输出顺序表;\n"<<endl;
putlist(L);
}
07-15
8982
04-08
3328