SHARE
TWEET

Zadanianko

a guest Oct 21st, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. #define SIZE 15
  4.  
  5. int main()
  6. {
  7.     int a = SIZE, j, i, m=0, k=0;
  8.     char tab[SIZE][SIZE];
  9.     for (a; a > SIZE / 2; a -= 2)
  10.     {
  11.         for (i = m; i < a; i++)
  12.         {
  13.             for (j = k; j < a; j++)
  14.             {
  15.                 tab[i][j] = (i + a == SIZE || j+a==SIZE||j==a-1||i==a-1) ? '*' : ' ';
  16.             }
  17.         }
  18.         m += 2;
  19.         k += 2;
  20. }
  21.     for (i = 0; i < SIZE; i++)
  22.     {
  23.         for (j = 0; j < SIZE; j++)
  24.         {
  25.             cout << tab[i][j];
  26.         }
  27.         cout << endl;
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top