shangzy1988
发表于 2015-3-22 23:17:48
HEhe
谁也不欠谁
发表于 2015-3-24 08:25:47
学习下,谢谢分享
OneSky
发表于 2015-3-25 14:38:17
强烈支持楼主ing……
网络小鱼
发表于 2015-3-29 16:48:52
可惜我看了还不会 柯南
网络小鱼
发表于 2015-3-29 19:40:36
for( t=*len-1; t >= i-1; t-- )
{
Sqlist = Sqlist;
}
Sqlist = x; 这段能不能注释下 小甲鱼
1085837634
发表于 2015-4-2 14:48:31
强烈支持楼主ing……
馨馨予
发表于 2015-4-3 10:12:53
强烈支持楼主ing……
晴天般微笑2015
发表于 2015-4-4 17:27:21
#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 10
typedef int ElemType;
typedef struct SqList
{
ElemType *data;
int size;
}SqList;
void Init_SqList(SqList *sqlist)
{
sqlist->data=(ElemType *)malloc(sizeof(ElemType)*MAXSIZE);
sqlist->size = 0;
}
void En_SqList(SqList *sqlist,int index,ElemType i)
{
int j;
if(index<1 || index>sqlist->size + 1)
{
printf("the index is not in the array\n");
return;
}
if(sqlist->size == MAXSIZE)
{
printf("the list is full\n");
return;
}
for(j=sqlist->size-1;j>=index-1;j--)
{
sqlist->data=sqlist->data;
}
sqlist->data = i;
sqlist->size++;
}
void Del_SqList(SqList *sqlist,int index,ElemType *i)
{
int j;
if(index<1 || index>sqlist->size + 1)
{
printf("the index is not in the array\n");
return;
}
*i=sqlist->data;
for(j=index-1; j<sqlist->size; j++)
{
sqlist->data = sqlist->data;
}
sqlist->size--;
}
void main()
{
SqList sqlist;
int j,m;
Init_SqList(&sqlist);
for(j=1; j<6; j++)
{
En_SqList(&sqlist,j,j);
}
if(sqlist.size == 5)
{
for(j=0;j<sqlist.size;j++)
{
printf("%d ",sqlist.data);
}
printf("\nthe remain space is %d\n",MAXSIZE-sqlist.size);
}
En_SqList(&sqlist,3,0);
for(j=0;j<sqlist.size;j++)
{
printf("%d ",sqlist.data);
}
printf("\nthe remain space is %d\n",MAXSIZE-sqlist.size);
printf("please input the inseart index:");
scanf("%d",&j);
En_SqList(&sqlist,j,0);
printf("please input the delete index:");
getchar();
scanf("%d",&j);
Del_SqList(&sqlist,j,&m);
for(j=0;j<sqlist.size;j++)
{
printf("%d ",sqlist.data);
}
printf("\nthe remain space is %d\n",MAXSIZE-sqlist.size);
}
hankang81
发表于 2015-4-7 08:02:26
不是回复了吗?
苍穹落雨
发表于 2015-4-12 09:47:15
谢谢分享
苍穹落雨
发表于 2015-4-12 09:59:49
好东西
Alphacoder
发表于 2015-4-12 10:13:35
nice!
微笑看世界
发表于 2015-4-13 17:52:03
旨在学习学习
睡沙发的沙皮狗
发表于 2015-4-28 21:17:31
强烈支持楼主ing……
微笑看世界
发表于 2015-4-30 09:20:15
我要用这些东西的
魔诀
发表于 2015-4-30 18:13:33
支持
460189852
发表于 2015-5-2 10:21:23
谢谢小甲鱼!!
hh977600959
发表于 2015-5-2 21:30:54
强烈支持楼主ing……
无影飞飞雪
发表于 2015-5-5 17:13:49
力顶小甲鱼
#无畏
发表于 2015-5-8 07:38:02
真是难得给力的帖子啊。