35657

Untitled

Nov 11th, 2023
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.    
  8.     setlocale(LC_ALL, "ru");
  9.  
  10.     int size;
  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 == size / 2 || j == size / 2 || i == j || i + j == size - 1) {
  17.                 cout << " * ";
  18.             }
  19.             else {
  20.                 cout << "   ";
  21.             }
  22.         }
  23.         cout << endl;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment