Advertisement
AquaBlitz11

TASK_043 - AquaBlitz11's Solution

Dec 31st, 2017
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     scanf("%d", &n);
  9.     for (int i = 0; i < n; ++i) {
  10.         for (int j = 0; j < n; ++j) {
  11.             int m = min(min(i, j), min(n-1-i, n-1-j));
  12.             if (m&1)
  13.                 printf("-");
  14.             else
  15.                 printf("*");
  16.         }
  17.         printf("\n");
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement