中兴面试题(3)
发布时间:2021-06-07
发布时间:2021-06-07
中兴面试题
/*建立*/
void creat(int array[])
{int i;
printf("enter the array:\n");
for(i=1;i<N;i++)
scanf("%d",&array[i]);
}
/*显示*/
void print(int array[])
{int i;
printf("The numbers after sort is:\n");
for(i=1;i<N;i++)
printf("%d ",array[i]);
printf("\n");
}
main()
{int a[11],i,x,chang;
/*printf("enter the array\n");
for(i=1;i<11;i++)
scanf("%d",&a[i]);*/
aga:
printf("\nchang:1: use watching method finding\n
finding\n 3: use directness intsert method sort\n
method sort\n 5:exit\n");
scanf("%d",&chang);
switch (chang)
{case 1:
{creat(a);
printf("Please int the search number:\n");
scanf("%d",&x);
printf("The number station is:%d\n",search(a,N,x));
goto aga;
}
case 2:
{ creat(a); 2:use half method 4:use bubble up