-
Notifications
You must be signed in to change notification settings - Fork 52
/
510A. Fox And Snake.cpp
46 lines (38 loc) · 811 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
46
//============================================================================
//problem link:http://codeforces.com/problemset/problem/510/A
// Name : .cpp
// Author : mohand sakr
// Version :
// Copyright : use it under your responsibility
// Description : Hello World in C++, Ansi-style
//status:accepted
//============================================================================
#include <iostream>
using namespace std;
int main() {
int n,m;
cin>>n>>m;
int oddness=0;
for(int i=0;i<n;i++){
if(i%2==0){
for(int j=0;j<m;j++){
cout<<"#";}
}
else {
++oddness;
for(int j=0;j<m;j++){
if(oddness%2==1&&j==m-1){
cout<<"#";
}
else if(oddness%2==0&&j==0){
cout<<"#";
}
else {
cout<<".";
}
}
}
cout<<"\n";
}
return 0;
}