Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include <graphics.h>
  4.  
  5. using namespace std;
  6.  
  7. void linie(int z)
  8. {
  9. if(z==1)
  10. {
  11. setcolor(WHITE);
  12. circle(145,70,12);
  13. setfillstyle(SOLID_FILL,WHITE);
  14. floodfill(146,70,WHITE);
  15.  
  16. setcolor(WHITE);
  17. line(145,40, 145, 70);
  18.  
  19. setcolor(WHITE);
  20. line(145,40, 240, 40);
  21.  
  22. setcolor(WHITE);
  23. line(240,40, 240, 300);
  24.  
  25. setcolor(WHITE);
  26. line(50,300, 240, 300);
  27.  
  28. }
  29. if(z==2)
  30. {
  31. setcolor(WHITE);
  32. line(145,70, 145, 170);
  33. }
  34. if(z==3)
  35. {
  36. setcolor(WHITE);
  37. line(80,100, 145, 120);
  38. }
  39. if(z==4)
  40. {
  41. setcolor(WHITE);
  42. line(145,120, 205, 100);
  43. }
  44. if(z==5)
  45. {
  46. setcolor(WHITE);
  47. line(145,170,205 , 220);
  48. }
  49. if(z==6)
  50. {
  51. setcolor(WHITE);
  52. line(145,170, 80, 220);
  53. }
  54.  
  55.  
  56.  
  57. }
  58.  
  59. void spanzuratoare ()
  60. {
  61.  
  62. char a[20],b[20],c;
  63. unsigned z=0;
  64. int contor=0;
  65.  
  66.  
  67. cin>>a;
  68.  
  69.  
  70. for(unsigned j=0;j<strlen(a);j++)
  71. b[j]='*';
  72. while((z<6) and strchr(b,'*')!=0)
  73. {
  74. contor=0;
  75. cin>>c;
  76. {
  77.  
  78. for(unsigned i=0;i<strlen(a);i++)
  79. if(c==a[i]and b[i]=='*')
  80. {
  81. for(unsigned k=0;k<strlen(a);k++)
  82. if(c==a[k])
  83. {
  84. b[k]=a[k];
  85. contor++;
  86. }
  87. cout<<b<<endl;
  88. }
  89. if(contor==0)
  90. {
  91. z++;
  92. linie(z);
  93.  
  94. }
  95. }
  96. }
  97. if(z==6)
  98. cout<<"ati pierdut";
  99. else
  100. cout<<"ati castigat";
  101. }
  102.  
  103.  
  104.  
  105.  
  106.  
  107. int main()
  108. {
  109. initwindow(800,600);
  110. spanzuratoare();
  111.  
  112. getch();
  113. closegraph();
  114.  
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement