怎么办啊。。。大家看看这段编码有哪几个问题呀?
#include<stdio.h>int a[15]
void main()
{
void sort(int a[]);
int i;
ptintf("input 15 numbers:\n");
for(i=0;i<15;i++)
scanf("%d",&a[i]);
printf("\n");
sort(a);
void search(int a[],int j);
int j;
printf("please enter a number:\n");
scanf("%d",&j);
search(j);
}
void sort(int a[])
{
int x,y,t;
for(x=0;x<14;x++)
for(y=0;y<14-x;y++)
if(a[y]<a[y+1])
{t=a[y];a[y]=a[y+1];a[y+1]=t;}
}
void search(int a[],int j)
{
int i,x,left=0,right=14,mid,find=0;
do{
mid=(left+right)/2;
if (x=a[mid])
{printf("a[%d]\n",mid);find=1;}
else if(x>a[mid])
{right=mid;}
else if(x<a[mid])
{left=mid+1;}
while(left<=right&&find==0);
if(find==0)
{printf("无此数");}
else {printf("\n");}
}
}