box world by rings

class test{public static void main(String[] a){int i,j,l;String s=new java.util.Scanner(System.in).nextLine();char[] c=s.toCharArray();l=c.length-1;s+=c[0]+"\n";for(i=0;i<l;){s+=c[l-i];for(j=0;j++<l;)s+=" ";s+=c[i++ +1]+"\n";}s+=c[0];for(i=l;i>=0;)s+=c[i--];System.out.print(s);}}

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

download

return to the top page