矩阵的相关操作
i=i+1;
else
cout<<"enter this data again:";
}
cout<<endl;
for(i=0;i<n;i++)
cout<<a[i]<<" ";
cout<<endl;
while(flag)
{
cout<<"please enter the number you look for :"<<endl; cin>>r;
sign=false;
top=n-1;
bott=0;
if(r<a[0]||r>a[n-1])
local=-1;
while(!sign&&bott<=top)
{ mid=(top+bott)/2;
if(a[mid]==r)
{ local=mid;
cout<<"the number is find:"<<"it is the "<<local+1<<" order:"<<a[mid]<<endl;
sign=true;
}
else if(r<=a[mid])
top=mid-1;
else
bott=mid+1;
}
if(!sign||local==-1)
cout<<"the number didn't find"<<endl;
cout<<"countin yes or not,input y or n"<<endl;
cin>>p;
if(p=='n'||p=='N')
flag=false;
}
return 0;
}
"<<"number of the