#includeint main(void){ int a[10]={ 1,2,3,4,5,6,7,8,9,10}; int low,high,mid,n=10,x; printf("Enter x:"); scanf("%d",&x); low=0;high=n-1; while(low<=high) { mid=(low+high)/2; if(x==a[mid]) break; else if(x
本文共 330 字,大约阅读时间需要 1 分钟。
#includeint main(void){ int a[10]={ 1,2,3,4,5,6,7,8,9,10}; int low,high,mid,n=10,x; printf("Enter x:"); scanf("%d",&x); low=0;high=n-1; while(low<=high) { mid=(low+high)/2; if(x==a[mid]) break; else if(x
转载于:https://www.cnblogs.com/lxhlxx900126/p/3353264.html