Java 山羊拉丁文

package SplitTest;
import java.util.Scanner;
public class SplitTest {
public static void main(String agrs[]) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
System.out.println(str);
String[] ss = str.split(" “);
int count = 1;
for(int i = 0;i < ss.length;i++) {
char[] a = ss[i].toCharArray();
String c = null;
StringBuffer b = new StringBuffer();
if(a[0] == ‘a’ || a[0] == ‘e’ || a[0] == ‘i’ || a[0] == ‘0’ || a[0] == ‘u’ || a[0] == ‘A’ || a[0] == ‘E’ || a[0] == ‘I’ || a[0] == ‘O’ || a[0] == ‘U’) {
for(int k = 0;k < a.length; k++) {
b.append(a[k]);
}
c = b.toString();
c = c+“m”;
}else {
for(int k = 1;k < a.length;k++) {
b.append(a[k]);
c = b.toString() + a[0] + “m”;
}
}
for(int j = 0;j < count;j++) {
c = c + “a”;
}
System.out.print(c+” ");
count++;
}
}
}

你可能感兴趣的:(Java 山羊拉丁文)