void whilee1(int *a,int shang,int xia,int num)// { cout << "shang\tzhong\txia\t " << endl; while (shang >=xia)//如果把序号大的看作上面用shang > xia,序号小的看作上面用xia<shang { int zhong = (shang + xia) / 2; cout << shang << "\t" << zhong << "\t" << xia << endl; if (num == a[zhong]) { cout << "whilee1 find" << endl; break; } else if (a[zhong]<num) { xia = zhong + 1; } else //(num<zhong) { shang = zhong - 1; } } if (xia >shang) { cout << "while1 not find " << endl; } }