#include void main(){ int x,l=0,m,h=9,a[10]={1,2,3,4,5,6,7,8,9,10}; scanf("%d",&x); m=(l+h)/2; while(a[m]!=x && l<=h) { if(a[m]>x) h=m-1; else l=m+1; m=(l+h)/2; } if(a[m]==x) printf("位置:%d",m+1); else printf("找不到");}