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_2/Task_3/main.cpp
Stanislav Mykhailenko a9b7ecf20c
Add Lesson 2
2024-06-24 18:19:29 +03:00

27 lines
601 B
C++

#include <iostream>
using namespace std;
int main()
{
int numbers[5];
int max = 0;
for (int number = 0; number < 5; ++number) {
cout << "Enter amount in " << number + 1 << " row: ";
cin >> numbers[number];
if (numbers[number] > max)
max = numbers[number];
}
for (int iteration = 0; iteration < max; ++iteration) {
for (int number = 0; number < 5; ++number) {
if (iteration < numbers[number])
cout << "*";
else
cout << " ";
}
cout << endl;
}
return 0;
}