void search(int n,int num[],char name[N][10])
{
int top,bottom,middle,location,flag;
top=0;
bottom=N-1;
location=0;
flag=1;
if((n<num[0])||(n>num[N-1]));
location=-1;
while((flag==1)&&(top<=bottom))
{
middle=(bottom+top)/2;
if(n==num[middle])
{
location=middle;
printf("Num.%d student's name is %s.\n",n,name[location]);
flag=-1;
}
else if(n<num[middle])
bottom=middle-1;
else top=middle+1;
}
if(flag==1||location==-1)
printf("Not found!\n");
}