Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. package W_09;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class T_09a {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. Scanner sc = new Scanner(System.in);
  10.  
  11. String s = sc.nextLine();
  12.  
  13. String[] arr1 = s.split(" ");
  14.  
  15. for(int i = 0; i < arr1.length;i++){
  16.  
  17. String[] arr = arr1[i].split("");
  18.  
  19. if(arr[arr.length-1].equals(".") || arr[arr.length-1].equals("!")){
  20.  
  21. char temp = arr1[i].charAt(0);
  22. char t2 = arr1[i].charAt(arr1[i].length()-1);
  23. String stemp = arr1[i].substring(1,arr1[i].length()-1);
  24. stemp += temp;
  25. stemp += "ay";
  26. stemp += t2;
  27. System.out.print(stemp + " ");
  28.  
  29.  
  30. }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") ||
  31. arr[0].equals("o") || arr[0].equals("O") || arr[0].equals("u") || arr[0].equals("U")){
  32.  
  33. arr1[i] += "ay";
  34.  
  35. System.out.print(arr1[i] + " ");
  36.  
  37. }else{
  38. char temp = arr1[i].charAt(0);
  39. String stemp = arr1[i].substring(1);
  40. stemp += temp;
  41. stemp += "ay";
  42.  
  43. System.out.print(stemp + " ");
  44.  
  45.  
  46. }
  47.  
  48.  
  49.  
  50. }
  51.  
  52.  
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement