public static int zheban(int[] shuzu,int shu)
{
int xiao=0,da=shuzu.length-1,zhong=(xiao+da)/2;
while(shu!=shuzu[zhong])
{
if (shu>shuzu[zhong])
xiao=zhong+1;
else if (shu<shuzu[zhong])
da=zhong-1;
zhong=(xiao+da)/2;
if(xiao>da)
return -1;
}
return zhong;
183.java:47: 错误: 可能尚未初始化变量zhong
int xiao=0,da=shuzu.length,zhong=(xiao+zhong)/2;
^
1 个错误