This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
NG_2024_Stanislav_Mykhailenko/Lesson_1/Task_6/main.cpp
Stanislav Mykhailenko 0ae4eb5552
Fix Lesson 1
2024-06-11 10:48:26 +03:00

27 lines
579 B
C++

#include <iostream>
using namespace std;
int main()
{
int size = 0;
cout << "Enter size: ";
cin >> size;
for (int iteration = 0; iteration < size; ++iteration) {
int spaces = size - iteration - 1;
int asterisks = 1 + iteration * 2;
for (int space = 0; space < spaces; ++space)
cout << " ";
for (int asterisk = 0; asterisk < asterisks; ++asterisk)
cout << "*";
cout << endl;
}
for (int space = 0; space < size - 1; ++space)
cout << " ";
cout << "*" << endl;
return 0;
}