#include #include #include #include"bubble.h" int i,x,t,times,j; int main() { bubbleSort();//on the internet srand(time(0)); for(i=0;i<2;i++) { //printf("\n1..."); x=rand(); printf("\nx=%5d",x); times=1; //printf("\n2..."); printf("\nnumber of: %2d integer to find",i+1); if(i==0) { j=rand()%100; while(list[j]!=x) { if(x>list[j]) { x--; } else x++; } } printf("\ninteger to find=%5d",x); printf("\n*times=%d",times); getchar(); t=binarySearch(0,100,x,×);//on the internet if(t!=-1) { printf("element:%10d found in position:%5d...\n",x,t); getchar(); } else{ printf("element:%10d was not found in none position...\n",x); } } getchar(); return 0; }