Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <graphics.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <math.h>
- #include <dos.h>
- using namespace std;
- const int n=10;
- int v[n]={3, 18, 22, 25, 48, 64, 72, 77, 82, 99};
- char* v1[n];
- int cautareBinara(int stg, int dr, int nr)
- {
- if(stg>dr)
- return -1;
- else
- {
- int mij=(stg+dr)/2;
- if(v[mij]==nr)
- return mij;
- if(nr<mij)
- return cautareBinara(stg,mij-1,nr);
- else
- return cautareBinara(mij+1,dr,nr);
- }
- }
- void cercuri(int x, int y)
- {
- // x=40;
- // y=250;
- for(int i=1; i<=n; i++)
- {
- setcolor(WHITE);
- circle(x,y,40);
- itoa(v[i],v1[i],10);
- outtextxy(x-20,y,v1[i]);
- x+=100;
- }
- getch();
- closegraph();
- }
- int main()
- {
- initwindow(800,600);
- int nr;
- cout<<"Introduceti numarul pe care il cautati in sir: ";
- cin>>nr;
- cercuri(40,250);
- //setcolor(WHITE);
- //circle(100,60,40);
- getch();
- closegraph();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement