#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++){ a[n-1-j][i+j]=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: 1206 User: mariooo Language: C++ Result: Accepted Time:8 ms Memory:2072 kb ****************************************************************/