asgarlikanan

https://www.e-olymp.com/az/problems/593

Aug 19th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.51 KB | None | 0 0
  1. /*
  2.     Author: Kanan Asgarli
  3.     https://www.e-olymp.com/az/problems/593
  4. */
  5. #include <iostream>
  6. #include <algorithm>
  7. using namespace std;
  8. int n, m, f;
  9. int main()
  10. {
  11.     cin>>n>>m;
  12.     if(n%2 == 0)
  13.         f = 1;
  14.     for(int i = 1; i <= n; i++){
  15.         for(int j = 1; j <= m; j++){
  16.             if((i-f)%2 == 1){
  17.                 if(j%2 == 1)
  18.                     cout<<".";
  19.                 else
  20.                     cout<<"X";
  21.             }
  22.             else{
  23.                 if(j%2 == 1)
  24.                     cout<<"X";
  25.                 else
  26.                     cout<<".";
  27.             }
  28.         }
  29.         cout<<endl;
  30.     }
  31.     return 0;
  32. }
Add Comment
Please, Sign In to add comment