Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: Kanan Asgarli
- https://www.e-olymp.com/az/problems/593
- */
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int n, m, f;
- int main()
- {
- cin>>n>>m;
- if(n%2 == 0)
- f = 1;
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= m; j++){
- if((i-f)%2 == 1){
- if(j%2 == 1)
- cout<<".";
- else
- cout<<"X";
- }
- else{
- if(j%2 == 1)
- cout<<"X";
- else
- cout<<".";
- }
- }
- cout<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment