fork download
  1. class M{
  2. static String c(int y){String a=" ",b=a,c="---",n="\n";for(int i=0;i<y;a+="$ ",b+="| ")if(y>0&i++>0)c+="--";c=c+n+c.replace('-','~')+n+c;return y<0?c:y>0?a+n+b+n+c:"Congratulations on your new baby! :D";}
  3.  
  4. public static void main(String[] a){
  5. System.out.println(c(1));
  6. System.out.println();
  7. System.out.println(c(3));
  8. System.out.println();
  9. System.out.println(c(25));
  10. System.out.println();
  11. System.out.println(c(0));
  12. System.out.println();
  13. System.out.println(c(-1));
  14. }
  15. }
Success #stdin #stdout 0.04s 712192KB
stdin
Standard input is empty
stdout
 $ 
 | 
---
~~~
---

 $ $ $ 
 | | | 
-------
~~~~~~~
-------

 $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ 
 | | | | | | | | | | | | | | | | | | | | | | | | | 
---------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------------------------------

Congratulations on your new baby! :D

---
~~~
---