Â
Â
#embrace <iostream>
utilizing
namespace
std;
Â
Â
void
sample(
int
N)
{
   Â
int
i, j, rely = 1;
Â
Â
   Â
   Â
for
(i = 1; i <= N; i++) {
Â
Â
       Â
       Â
       Â
for
(j = 1; j <= i; j++) {
Â
Â
           Â
if
(j < i)
Â
Â
               Â
cout << rely++ <<
"*"
;
Â
Â
           Â
else
Â
Â
               Â
cout << rely++;
       Â
}
       Â
cout << endl;
   Â
}
   Â
rely = rely - N;
Â
Â
   Â
   Â
for
(i = N; i >= 1; i--) {
Â
Â
       Â
       Â
       Â
for
(j = 1; j <= i; j++) {
Â
Â
           Â
if
(j < i)
Â
Â
               Â
cout << rely++ <<
"*"
;
Â
Â
           Â
else
Â
Â
               Â
cout << rely++;
       Â
}
       Â
rely = (rely + 1) - 2 * i;
       Â
cout << endl;
   Â
}
}
Â
Â
int
foremost()
{
   Â
int
N = 4;
Â
Â
   Â
   Â
sample(N);
   Â
return
0;
}