level 6
mobinsheng
楼主
#include<iostream>
using namespace std;
typedef ElemType int
typedef struct
{ ElemType *elem;
int length;
int listsize;
int increamentsize;
} Sqlist;
void InitList_Sq(Sqlist &L)
{
L.elem=new ElemType[100];
L.length=0;
L.increamentsize=10;
L.listsize=100;
}
void p(Sqlist &L)
{
int j;
cout<<"shuru10geshu"<<endl;
for(int i=0;1<10;i++)
{
cin>>j;
L.length++;
L.elem[i]=j;
}
}
void ListInsert_Sq(Sqlist &L,ElemType e)
{
for(int i=0;i<L.length;i++)
{
int k=0;
if(L.elem[i]>e)
k++;
}
for(int i=L.length;i>k;i--)
{
L.elem[i]=L.elem[i-1];
}
L.elem[k]=e;
++L.length;
}
void main()
{
int m;
Sqlist S;
cin>>m;
InitList_Sq(S);
p(S);
ListInsert_Sq(S,m);
for(int i=0;i<S.length;i++)
cout<<S.elem[i];
}
不能运行!!
错误时“F:\编程\C++\14\0.cpp(68) : error C2236: unexpected 'struct' '__unnamed'
”
求解??
在线等!!!!!
2009年09月22日 04点09分
1
using namespace std;
typedef ElemType int
typedef struct
{ ElemType *elem;
int length;
int listsize;
int increamentsize;
} Sqlist;
void InitList_Sq(Sqlist &L)
{
L.elem=new ElemType[100];
L.length=0;
L.increamentsize=10;
L.listsize=100;
}
void p(Sqlist &L)
{
int j;
cout<<"shuru10geshu"<<endl;
for(int i=0;1<10;i++)
{
cin>>j;
L.length++;
L.elem[i]=j;
}
}
void ListInsert_Sq(Sqlist &L,ElemType e)
{
for(int i=0;i<L.length;i++)
{
int k=0;
if(L.elem[i]>e)
k++;
}
for(int i=L.length;i>k;i--)
{
L.elem[i]=L.elem[i-1];
}
L.elem[k]=e;
++L.length;
}
void main()
{
int m;
Sqlist S;
cin>>m;
InitList_Sq(S);
p(S);
ListInsert_Sq(S,m);
for(int i=0;i<S.length;i++)
cout<<S.elem[i];
}
不能运行!!
错误时“F:\编程\C++\14\0.cpp(68) : error C2236: unexpected 'struct' '__unnamed'
”
求解??
在线等!!!!!