fork(1) download
  1. class M{
  2. public static void main(String[] a){
  3. System.out.println(c("Hello, World!"));
  4. System.out.println(c("lorem ipsum dolor sit amet."));
  5. System.out.println(c("We praise the Goat God!"));
  6. System.out.println(c("I have a pen"));
  7. System.out.println(c("0123456789_"));
  8. System.out.println(c("0te_st1"));
  9. }
  10.  
  11. static String c(String s){String r="",z="e([^e]|$)";char p=0;int x;for(char c:s.toCharArray()){x=c&~32;p=x>64&x<91?p==66?'l':p>100&p<109?'e':66:c;r+=p;}return r.replaceAll("l"+z,"lt$1").replaceAll(z,"et$1");}
  12. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
Bleeet, Bleeet!
Bleeet Bleeet Bleeet Blt Bleet.
Bl Bleeeet Blt Bleet Blt!
B Bleet B Blt
0123456789_
0Bl_Bl1