#pattern printing

problem link–>Problem - 118B - Codeforces
why my code printing this instead of this…
expected–>
0
0 1 0
0 1 2 1 0
0 1 2 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 4 5 4 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 2 1 0
0 1 2 1 0
0 1 0
0

I got —>

  0
 0 0
0 1 0

0 1 2 1 0
0 1 2 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 2 1 0
0 1 2 1 0
0 1 0
0 0
0

code–>
#include
#include
using namespace std;

int main() {
#ifndef ONLINE_JUDGE

freopen("input.txt", "r", stdin);

freopen("output.txt", "w", stdout);

#endif

int n;
cin>>n;
int j;
for (int i = 0; i < n; ++i)
{

for (int o = 0; o < n-i ; ++o)
{
/* code */
cout<<" ";
}

for ( j = 0; j < i; ++j)
{
cout<<j<<" ";

}

for (int k = j-2; k >0 ; k–)
{
// cout<<" ";
cout<<k;

  cout<<" ";

}
cout<<“0”;
cout<<endl;
}

for (int i = n-1; i >=0; --i)
{

for (int o = n-i; o >=0 ; --o)
{
/* code */
cout<<" ";
}

for ( j = 0; j < i; ++j)
{
cout<<j<<" ";

}

for (int k = j-2; k > 0 ; k–)
{

  //cout<<" ";
cout<<k;
if(k > 0)

cout<<" ";
}
cout<<“0”;
cout<<endl;
}
return 0;
}

instead of posting the entire code just give a link to your solution…
its much easier to read code that is formatted

you can also use websites like ideone.com and post a link to your code

kk thanks

comment yout code by ``` before and after code -

print("HII")