#include<bits/stdc++.h> using namespace std; int main(){ int i,j,n,a[15][15]={0}; cin>>n; int k=1; for(i=0;i<n;i++){ for(j=0;j<n-i;j++){ if(i==0){ a[j][j]=k; }else{ a[j][j+i]=k; } } k++; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(a[i][j]==0){ cout<<setw(5)<<" "; }else{ cout<<setw(5)<<a[i][j]; } } cout<<endl; } } /************************************************************** Problem: 1204 User: mariooo Language: C++ Result: Accepted Time:9 ms Memory:2072 kb ****************************************************************/