Last active
November 28, 2018 18:54
-
-
Save TheFauxFox/73cd2985861998fdf08175a478a2f58f to your computer and use it in GitHub Desktop.
I'm otnay ootay uresay why I idday isthay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class Main { | |
public static void main(String[] args) { | |
while(true) { | |
Scanner s = new Scanner(System.in); | |
String st = s.nextLine(); | |
if(st.equals("")) {System.exit(0);} | |
for(String sr : st.split("\\s+")) { | |
Matcher p = Pattern.compile("(.*?)([aeiou].*)").matcher(sr); | |
p.matches(); | |
try { | |
System.out.print(sr.substring(p.group(1).length()) + p.group(1) + "ay "); | |
} | |
catch (Exception e){ | |
System.out.print(sr + " "); | |
} | |
} | |
System.out.println(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment