Skip to content

Instantly share code, notes, and snippets.

@6LYTH3
Created July 16, 2011 03:58
Show Gist options
  • Save 6LYTH3/1085988 to your computer and use it in GitHub Desktop.
Save 6LYTH3/1085988 to your computer and use it in GitHub Desktop.
ACM_A Tale from the Dark Side of The Moon
package main;
import java.io.File;
import java.util.Scanner;
public class TheMoon {
public static void main(String[] args)throws Throwable{
File file = new File("txt");
Scanner sc = new Scanner(file);
String str;
while(sc.hasNext()){
str = sc.nextLine();
if(str.equals("EOF")) break;
System.out.println(str.replaceAll("dd","p").replaceAll("pink", "floy").replaceAll("[0-9]","").replaceAll("[A-Z]","").replaceAll("[@#$%^,&!+=.]","").replaceAll("ei", "ie"));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment