Advertisement
Ar3mida

N_3

Oct 20th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n;
  6.     cin >> n;
  7.     int a[15][15];
  8.  
  9.     for (int i = 0; i < n; i++) {
  10.         for (int j = 0; j < n; j++) {
  11.             if (i == j || i == n - 1 - j || i == n / 2 || j == n / 2) a[i][j] = 1;
  12.             else a[i][j] = 0;
  13.         }
  14.     }
  15.     for (int i = 0; i < n; i++) {
  16.         for (int j = 0; j < n; j++) {
  17.             if (a[i][j] == 0) cout << "." << " ";
  18.             else cout << "*" << " ";
  19.         }
  20.         cout << endl;
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement