-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path510A Fox And Snake.cpp
48 lines (42 loc) · 952 Bytes
/
510A Fox And Snake.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<bits/stdc++.h>
#define nl "\n"
#define fori(start,end,increment) for (int i = start; i < end; i+=increment)
#define forj(start,end,increment) for (int j = start; j < end; j+=increment)
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long int lli;
typedef long int li;
typedef long double llf;
using namespace std;
int main()
{
fio;
int row, col, cnt=0;
cin >> row >> col;
fori(0,row,1)
{
if(i%2==0)
{
forj(0,col,1)
cout << "#";
cout << nl;
}
else
{
if(cnt==0)
{
forj(0,col-1,1)
cout << ".";
cout << "#" << nl;
cnt++;
}
else
{
cout << "#";
forj(0,col-1,1)
cout << ".";
cout << nl;
cnt--;
}
}
}
}