Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 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. return;
  28.  
  29. }
  30. if(z==2)
  31. {
  32. setcolor(WHITE);
  33. line(145,70, 145, 170);
  34. return;
  35.  
  36. }
  37. if(z==3)
  38. {
  39. setcolor(WHITE);
  40. line(80,100, 145, 120);
  41. return;
  42. }
  43. if(z==4)
  44. {
  45. setcolor(WHITE);
  46. line(145,120, 205, 100);
  47. return;
  48. }
  49. if(z==5)
  50. {
  51. setcolor(WHITE);
  52. line(145,170,205 , 220);
  53. return;
  54. }
  55. if(z==6)
  56. {
  57. setcolor(WHITE);
  58. line(145,170, 80, 220);
  59. return;
  60. }
  61.  
  62.  
  63.  
  64. }
  65.  
  66. void spanzuratoare ()
  67. {
  68.  
  69. char a[20],b[20],c;
  70. unsigned z=0;
  71. int contor=0;
  72.  
  73.  
  74. cin>>a;
  75.  
  76.  
  77. for(unsigned j=0;j<strlen(a);j++)
  78. b[j]='*';
  79. while((z<6) and strchr(b,'*')!=0)
  80. {
  81. contor=0;
  82. cin>>c;
  83. {
  84.  
  85. for(unsigned i=0;i<strlen(a);i++)
  86. if(c==a[i]and b[i]=='*')
  87. {
  88. for(unsigned k=0;k<strlen(a);k++)
  89. if(c==a[k])
  90. {
  91. b[k]=a[k];
  92. contor++;
  93. }
  94. cout<<b<<endl;
  95. }
  96. if(contor==0)
  97. {
  98. z++;
  99. linie(z);
  100.  
  101. }
  102. }
  103. }
  104. if(z==6)
  105. cout<<"ati pierdut";
  106. else
  107. cout<<"ati castigat";
  108. }
  109.  
  110.  
  111.  
  112.  
  113.  
  114. int main()
  115. {
  116. initwindow(400,400);
  117. spanzuratoare();
  118.  
  119. getch();
  120. closegraph();
  121.  
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement