0
******x****** *****xxx***** ****xxxxx**** ***xxxxxxx*** **xxxxxxxxx** *xxxxxxxxxxx* xxxxxxxxxxxxx
2 odpowiedzi
+ 7
http://code.sololearn.com/cpf6MUnPGa98/#cpp
#include <iostream>
using namespace std;
int main()
{
int n = 7; // number of rows you want
// rows of the pattern
for (int row = 0; row < n; row++) {
// spaces ('*') to the left
for (int j = 0; j < n - row - 1; j++) {
cout << '*';
}
// main pyramid
for (int k = 0; k < row * 2 + 1; k++) {
cout << 'x';
}
// spaces ('*') to the right
for (int l = 0; l < n - row - 1; l++) {
cout << '*';
}
cout << endl;
}
return 0;
}