35657

Untitled

Feb 9th, 2024
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7.     setlocale(LC_ALL, "ru");
  8.  
  9.     int size;
  10.  
  11.     cout << "Введите размер фигуры (нечетное число): ";
  12.     cin >> size;
  13.  
  14.     for (int i = 0; i < size; i++) {
  15.         for (int j = 0; j < size; j++) {
  16.             if (i == j || j == size / 2 || i == size / 2 || i == size - j - 1) {
  17.                 cout << " * ";
  18.             }
  19.             else {
  20.                 cout << "   ";
  21.             }
  22.            
  23.         }
  24.         cout << endl;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment