麻烦帮我看一下 这道题哪里错了?#include #include #include #define MAXIZE 30typedef struct SList{int Data[MAXSIZE];int Last;}SList;SList InitSList(){SList L;L.Last=-1;return L;}SList InputSList( SList L){int x=0;printf("\n请输入数据,

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 08:12:42

麻烦帮我看一下 这道题哪里错了?#include #include #include #define MAXIZE 30typedef struct SList{int Data[MAXSIZE];int Last;}SList;SList InitSList(){SList L;L.Last=-1;return L;}SList InputSList( SList L){int x=0;printf("\n请输入数据,
麻烦帮我看一下 这道题哪里错了?
#include
#include
#include
#define MAXIZE 30
typedef struct SList
{
int Data[MAXSIZE];
int Last;
}
SList;
SList InitSList()
{
SList L;
L.Last=-1;
return L;
}
SList InputSList( SList L)
{
int x=0;
printf("\n请输入数据,结束输入-1!\n");
scanf("%d",&x);
while (x!=-1)
{
L.Data[++L.Last]=x;
if(L.Last==MAXSIZE-1)
{
printf("\n顺序表已满!\n");
break;
}
scanf("%d",&x);
}
return L;
getch();
}

麻烦帮我看一下 这道题哪里错了?#include #include #include #define MAXIZE 30typedef struct SList{int Data[MAXSIZE];int Last;}SList;SList InitSList(){SList L;L.Last=-1;return L;}SList InputSList( SList L){int x=0;printf("\n请输入数据,
唯一的问题
return L;
getch(); //如果是用这个来暂停程序 放在return后面永远运行不到