金陵科技学院实验报告
sequenlist l={{2,5,6,8,2,8,4,3},7};
printf("\nThe list is:");
for(i=0;i<=l.last;i++) printf("%2d",l.data[i]);
}
2、#dene maxsize 100
typedef struct{
int data[maxsize];
int last;
}sequenlist;
main()
{
int x,i,s=-1;
sequenlist l={{2,5,6,7,9,8,4,3},7};
printf("\nThe list is:");
for(i=0;i<=l.last;i++)
printf("%2d",l.data[i]);
printf("\nPlease input the number :");
scanf("%d",&x);
for(i=0;i<=l.last;i++)
if(l.data[i]==x)
{s=i;break;
}
printf("%d",s);
}
3、#dene maxsize 100
typedef struct{
int data[maxsize];
int last;
}sequenlist;
main()
{
int i,x,j;
sequenlist l={{1,3,5,6,7,9},5};
printf("\nThe list is:");
for(i=0;i<=l.last;i++)
评论1
最新资源