fork download
  1. class A{
  2. public static void main(String[] args) {
  3. new A().m(3);
  4. new A().m(4);
  5. new A().m(5);
  6. new A().m(6);
  7. new A().m(7);
  8. new A().m(8);
  9. }
  10.  
  11. void m(int n){int i=2,r=n%2,x=2*n,u=r+2,y=r*4+(int)(Math.random()*2)*u,z=y+u;String t="MFZJMAFHMF".substring(y,z);char[][]c=new char[n][x+1];while(i<x-1)c[0][i]=c[n-1][i++]=64;for(i=0;i<u;)c[(n-1)/2+(1-r)*i][r*(i-1)+n]=t.charAt(i++);for(i=0;i<n;){c[i][0]=40;c[i][1]=c[i][x-1]=64;c[i][x]=41;System.out.println(new String(c[i++]).replace('\0',' '));}}
  12. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
(@@@@@)
(@HMF@)
(@@@@@)
(@@@@@@@)
(@  M  @)
(@  F  @)
(@@@@@@@)
(@@@@@@@@@)
(@       @)
(@  MAF  @)
(@       @)
(@@@@@@@@@)
(@@@@@@@@@@@)
(@         @)
(@    M    @)
(@    F    @)
(@         @)
(@@@@@@@@@@@)
(@@@@@@@@@@@@@)
(@           @)
(@           @)
(@    HMF    @)
(@           @)
(@           @)
(@@@@@@@@@@@@@)
(@@@@@@@@@@@@@@@)
(@             @)
(@             @)
(@      M      @)
(@      F      @)
(@             @)
(@             @)
(@@@@@@@@@@@@@@@)