Homework 1: task 2

This commit is contained in:
Inex Code 2020-09-16 09:27:26 +00:00
parent e92805eb58
commit 9ce05da1d9

View file

@ -16,12 +16,31 @@ void part1(uint N, uint M)
cout << "\n";
}
void part2(uint N, uint M)
{
for (uint n = 0; n < N; n++)
{
if (n < M)
for (uint i = 0; i < M-n; i++)
{
cout << " ";
}
for (uint j = 0; j < n*2; j++)
{
cout << "*";
}
cout << "\n";
}
cout << "\n";
}
int main()
{
uint N = 5;
uint N = 6;
uint M = 6;
part1(N, M);
part2(N, M);
return 0;
}