forked from nikhiljugale007/CodeForces
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFoxAndSnake.cpp
More file actions
37 lines (34 loc) · 748 Bytes
/
FoxAndSnake.cpp
File metadata and controls
37 lines (34 loc) · 748 Bytes
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
#include <bits/stdc++.h>
using namespace std ;
int main(){
int n , m ;
cin >> n >> m ;
int count = 0 ;
int flag= 1;
for(int i=0;i<n;i++){
if(count == 0){
for(int j=0;j<m;j++){
cout<<"#";
}
cout<<endl;
count++;
}
else if(flag==1){
for(int j=0;j<m-1;j++){
cout<<".";
}
cout<<"#"<<endl;
flag = 2 ;
count=0;
}
else if (flag == 2){
cout<<"#";
for(int j=1;j<m;j++){
cout<<".";
}
cout<<endl;
flag=1;
count=0;
}
}
}