Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6. char c;
  7. int a[4][4];
  8. void afisare (int a[4][4])
  9. {
  10. int i,j;
  11. for(i=1; i<=3; i++)
  12. {
  13. for(j=1; j<=3; j++)
  14. {
  15. if(a[i][j]==0)
  16. cout<<"#";
  17. else
  18. {
  19. if(a[i][j]==1)
  20. cout<<"0";
  21. else
  22. cout<<"x";
  23. }
  24. cout<<"\n";
  25. }
  26. }
  27. }
  28. void citeste ()
  29. {
  30. for(;;)
  31. {
  32. cin>>lin>>col;
  33. if(lin>=1 && lin<=3 && col>=1 && col<=3 &&a[lin][col]==0)
  34. return;
  35. }
  36. }
  37. int main()
  38. {
  39.  
  40. for(pas=1;;pas++)
  41. {
  42. afisare (a);
  43. c=getch();
  44. if(c=='a')
  45. break;
  46. }
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement