Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <graphics.h>
- using namespace std;
- void linie(int z)
- {
- if(z==1)
- {
- setcolor(WHITE);
- circle(145,70,12);
- setfillstyle(SOLID_FILL,WHITE);
- floodfill(146,70,WHITE);
- setcolor(WHITE);
- line(145,40, 145, 70);
- setcolor(WHITE);
- line(145,40, 240, 40);
- setcolor(WHITE);
- line(240,40, 240, 300);
- setcolor(WHITE);
- line(50,300, 240, 300);
- return;
- }
- if(z==2)
- {
- setcolor(WHITE);
- line(145,70, 145, 170);
- return;
- }
- if(z==3)
- {
- setcolor(WHITE);
- line(80,100, 145, 120);
- return;
- }
- if(z==4)
- {
- setcolor(WHITE);
- line(145,120, 205, 100);
- return;
- }
- if(z==5)
- {
- setcolor(WHITE);
- line(145,170,205 , 220);
- return;
- }
- if(z==6)
- {
- setcolor(WHITE);
- line(145,170, 80, 220);
- return;
- }
- }
- void spanzuratoare ()
- {
- char a[20],b[20],c;
- unsigned z=0;
- int contor=0;
- cin>>a;
- for(unsigned j=0;j<strlen(a);j++)
- b[j]='*';
- while((z<6) and strchr(b,'*')!=0)
- {
- contor=0;
- cin>>c;
- {
- for(unsigned i=0;i<strlen(a);i++)
- if(c==a[i]and b[i]=='*')
- {
- for(unsigned k=0;k<strlen(a);k++)
- if(c==a[k])
- {
- b[k]=a[k];
- contor++;
- }
- cout<<b<<endl;
- }
- if(contor==0)
- {
- z++;
- linie(z);
- }
- }
- }
- if(z==6)
- cout<<"ati pierdut";
- else
- cout<<"ati castigat";
- }
- int main()
- {
- initwindow(400,400);
- spanzuratoare();
- getch();
- closegraph();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement