Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package W_09;
- import java.util.Scanner;
- public class T_09a {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String s = sc.nextLine();
- String[] arr1 = s.split(" ");
- for(int i = 0; i < arr1.length;i++){
- String[] arr = arr1[i].split("");
- if(arr[arr.length-1].equals(".") || arr[arr.length-1].equals("!")){
- char temp = arr1[i].charAt(0);
- char t2 = arr1[i].charAt(arr1[i].length()-1);
- String stemp = arr1[i].substring(1,arr1[i].length()-1);
- stemp += temp;
- stemp += "ay";
- stemp += t2;
- System.out.print(stemp + " ");
- }else if(arr[0].equals("a") || arr[0].equals("A") || arr[0].equals("e") || arr[0].equals("E") || arr[0].equals("i") || arr[0].equals("I") ||
- arr[0].equals("o") || arr[0].equals("O") || arr[0].equals("u") || arr[0].equals("U")){
- arr1[i] += "ay";
- System.out.print(arr1[i] + " ");
- }else{
- char temp = arr1[i].charAt(0);
- String stemp = arr1[i].substring(1);
- stemp += temp;
- stemp += "ay";
- System.out.print(stemp + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement