#include
using namespace std;
int main() {
int n;
cin>>n;
int i,j;
int m=2*n;
char sp=’ ‘;
for(i=1;i<=n;i++){
for(j=1;j<=m-1;j++){
if(j<=i){
cout<<j<<’ ‘;
}
if(j>=m-i){
cout<<m-j<<’ ‘;
}
else{
cout<<sp<<’ ';
}
}
cout<<endl;
}
return 0;
}
output:
1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 4 3 2 1
what part of my code is wrong?