2020-09-11 16:17:16 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2020-09-12 06:56:28 +00:00
|
|
|
void part1(uint N, uint M)
|
|
|
|
{
|
2020-09-19 11:41:40 +00:00
|
|
|
for (uint n = 0; n < N; n++) {
|
|
|
|
for (uint m = 0; m < M; m++) {
|
|
|
|
cout << "*";
|
|
|
|
}
|
|
|
|
cout << "\n";
|
|
|
|
}
|
|
|
|
cout << "\n";
|
2020-09-12 06:56:28 +00:00
|
|
|
}
|
|
|
|
|
2020-09-16 09:27:26 +00:00
|
|
|
void part2(uint N, uint M)
|
|
|
|
{
|
2020-09-19 11:41:40 +00:00
|
|
|
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";
|
2020-09-16 09:27:26 +00:00
|
|
|
}
|
|
|
|
|
2020-09-11 16:17:16 +00:00
|
|
|
int main()
|
|
|
|
{
|
2020-09-19 11:41:40 +00:00
|
|
|
uint N = 6;
|
|
|
|
uint M = 6;
|
2020-09-11 16:17:16 +00:00
|
|
|
|
2020-09-19 11:41:40 +00:00
|
|
|
part1(N, M);
|
|
|
|
part2(N, M);
|
2020-09-11 16:17:16 +00:00
|
|
|
|
2020-09-19 11:41:40 +00:00
|
|
|
return 0;
|
2020-09-11 16:17:16 +00:00
|
|
|
}
|