I am unable to solve

I tried to solve this problem but I am unable print pattern properly please help me . I tried to code from what I thought was right but it was wrong . This is my code:

int main()
{

int n,i,j;
cin>>n;


for(i=1;i<n;i++){
    for(j=1;j<i;j++){
        cout<<j;
        for(int k=n-1;k>=0;k--){
            cout<<"\t";
        }
        cout<<j;
        cout<<endl;
    }
}


return 0;

}

what you done is first print j and then for every j you print n-1 tabs
and again print j
so output is according to what you right
i hope you understand what you have done.

now to solve this problem you have break it into 3 parts
first part is printing nos staring form 1 to i
second part is printing spaces
third part is printing nos form i to 1

first try this at your own if find dificulty you can see
this CODE