fork download
  1. class M{
  2. static String c(String s){
  3. String h = "Hillary Clinton",
  4. d = "Donald Trump",
  5. r = h+" ===Q===>\n"+d+" ===X===>\nZ===J===>";
  6. boolean H = h.equals(s),
  7. D = d.equals(s);
  8. for(int i = s.length(); i++ < 18; s += " ");
  9. return r.replace(H?"Q":D?"X":"J", "-----")
  10. .replace(H|D?"Z":"~", "____________ ")
  11. .replaceAll(H?"X|J":D?"Q|J":"Q|X", " ")
  12. .replace(H|D?"~":"Z", s);
  13. }
  14.  
  15. public static void main(String[] a){
  16. System.out.println(c("Hillary Clinton"));
  17. System.out.println();
  18. System.out.println(c("Donald Trump"));
  19. System.out.println();
  20. System.out.println(c("Anyone else?.."));
  21. System.out.println();
  22. System.out.println(c("S"));
  23. System.out.println();
  24. System.out.println(c("Anyone who is willing to take the job"));
  25. }
  26. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
Hillary Clinton   ===-----===>
Donald Trump      ===     ===>
____________      ===     ===>

Hillary Clinton   ===     ===>
Donald Trump      ===-----===>
____________      ===     ===>

Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Anyone else?..    ===-----===>

Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
S                 ===-----===>

Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Anyone who is willing to take the job===-----===>