我刚接触C语言,有很多的问题,呵呵,希望高手们不吝赐教,呵呵,这次是关于拆半查找法的问题,大家应该都知道,可是我就是不理解这个程序是怎么实现的,希望高手们能指点一下,以下是程序代码:
#include
main()
{
char c,a[10]="abcdefghi";
int top,bot,mid;
printf("input c:\n");
scanf ("%c",&c);
printf ("c=\'%c\'\n",c);
for (top=0,bot=10;topa[mid]) top=mid+1;
else bot=mid-1;
}
if (top>bot) printf ("**\n");
}
|