fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int n;
  7. cin >> n;
  8.  
  9. for (int i = 0; i < n; i++) {
  10. for (int j = 0; j < n; j++) {
  11. int index = (i + j) % n;
  12. cout << 2 * index + 1;
  13. }
  14. cout << endl;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5316KB
stdin
4
stdout
1357
3571
5713
7135