Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <stdlib.h>
- using namespace std;
- char c;
- int a[4][4];
- void afisare (int a[4][4])
- {
- int i,j;
- for(i=1; i<=3; i++)
- {
- for(j=1; j<=3; j++)
- {
- if(a[i][j]==0)
- cout<<"#";
- else
- {
- if(a[i][j]==1)
- cout<<"0";
- else
- cout<<"x";
- }
- cout<<"\n";
- }
- }
- }
- void citeste ()
- {
- for(;;)
- {
- cin>>lin>>col;
- if(lin>=1 && lin<=3 && col>=1 && col<=3 &&a[lin][col]==0)
- return;
- }
- }
- int main()
- {
- for(pas=1;;pas++)
- {
- afisare (a);
- c=getch();
- if(c=='a')
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement