Quick actions

cmd+k|ctrl+k

Navigation

Languages

No 1

Snippet info

Language

Cpp

Visibility

public

Author

creditfool

Created

2020-11-19T04:15:51Z

Updated

2020-11-19T04:15:51Z

#include <iostream>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    
    for (int x=0; x<N; x++) 
    {
        for (int y=0; y<N; y++) 
        {
            if ( (x+y) % M == 0) {
                cout << 'X';
            } else {
                cout << 'O';
            }
        }
        cout << '\n';
    }
}
INFO