二分法问题!求解释!错哪里了?
#include"stdio.h"#define N 10;
int main()
{
int key,low,mid,high,location,sucess=0;
int a[N]={12,15,24,25,28,34,48,78,89,99};
printf("请输入您要查找的数字,将以2分法进行查找:");
scanf("%d",&key);
low=0;high=N-1;
while(low<high)
{
mid=(low+high)/2;
if(key==a[mid]){sucess=1;location=mid;break;}
if(key<a[mid])
high=mid-1;
else
low=mid+1;
}
if(sucess==1)
printf("发现目标数字%d,位于%d!\n",key,location);
else
printf("未发现目标数字%d\n",key);
return 0;
}
--------------------Configuration: da - Win32 Debug--------------------
Compiling...
.c
D:\360Windows7\Microsoft Visual Studio\MyProjects\da\.c(6) : error C2143: syntax error : missing ']' before ';'
D:\360Windows7\Microsoft Visual Studio\MyProjects\da\.c(6) : error C2143: syntax error : missing ';' before ']'
执行 cl.exe 时出错.
.obj - 1 error(s), 0 warning(s)
怎么看都没错啊??