Triangle by Debanjan

t,r,c;main(n,j){for(scanf("%d",&n);(t+=r++)<n;);for(t-=--r;r;t-=--r,puts("")){for(c=0,j=t;j<n;j+=++c+r)printf("%d%s",j+1,j+c+1+r>=n?"":" ");}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page