char pyramid by darefilz

using C=System.Console;class P{static void Main(){string t=C.ReadLine(),s="";for(int l=t.Length,i=0,j;i<l;++i,s=""){for(j=l-i-1;j<l-1;++j)s+=t[j]+" ";C.WriteLine((s+t[l-1]).PadLeft(i+l).PadRight(l*2-1));}}}

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

download

return to the top page