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

28 lines
601 B
C++
Raw Permalink Normal View History

2024-06-24 15:19:29 +00:00
#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;
}