Advertisement
rengetsu

Codeforces_510A

Aug 7th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.30 KB | None | 0 0
  1. //Codeforces Round 510A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, m, ch=0, nz=0;
  7.     cin >> n >> m;
  8.     for(int i=0;i<n;i++)
  9.     {
  10.         if(i%2==0)
  11.         {
  12.             ch=0;
  13.         }
  14.         else
  15.         {
  16.             ch=1;
  17.         }
  18.         for(int y=0;y<m;y++)
  19.         {
  20.             if(y!=(m-1) && y!=0)
  21.             {
  22.                 if(ch==0){cout<<"#";}
  23.                 if(ch==1){cout<<".";}
  24.             }
  25.             else if(y==(m-1))
  26.             {
  27.                 if(ch==0){cout<<"#";}
  28.                 if(ch==1){
  29.                
  30.                     if(nz==0)
  31.                     {
  32.                         cout<<".";
  33.                     }
  34.                     else
  35.                     {
  36.                         cout << "#";
  37.                     }
  38.                 }
  39.             }
  40.             else if(y==0)
  41.             {
  42.                 if(ch==0){cout<<"#";}
  43.                 if(ch==1){
  44.                     if(nz==0)
  45.                     {
  46.                         cout<<".";
  47.                         nz=1;
  48.                     }
  49.                     else
  50.                     {
  51.                         cout << "#";
  52.                         nz=0;
  53.                     }
  54.                 }
  55.             }
  56.         }
  57.         cout << endl;
  58.     }
  59.     return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement