请大家帮我一下,为什么输不出查找的结果了!
#include<stdio.h>main()
{
int aa[24]={1,2,3,5,4,6,9,8,7,11,24,21,12,34,};
int bb[24]={0};
int *p,i,j,k,cc;
int m,n,h;
n=0;h=23;
p=aa;
for(j=0;j<23;j++)
{
for(i=0;i<23-j;i++)
{
if(aa[i]<aa[i+1])
{
k=aa[i+1];
aa[i+1]=aa[i];
aa[i]=k;
}
}
}
for(i=0;i<24;i++)
{
printf("%d\t",aa[i]);
}
printf("\n");
scanf("%d",&cc);
while(n<=h)
{
m=(h+n)/2;
if(cc==aa[m])
{ printf("找到了,在第%d个",m);break;}
else if(cc<aa[m])
h=m;
else if(cc>aa[m])
n=m;
}
if(n>h)
{printf("找不到");}
}