fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. private static final String vowels = "aeiouy";
  11. private static final String consonants = "bcdfghjklmnpqrstvwxyz";
  12. private static final String all = vowels + consonants;
  13.  
  14. public static void main (String[] args) throws java.lang.Exception
  15. {
  16. int n = Integer.parseInt(br.readLine());
  17. boolean lastVowel = false;
  18. StringBuilder sb = new StringBuilder(n);
  19. Random rand = new Random();
  20. for(int i = 0; i < n; ++i)
  21. {
  22. int c = rand.nextInt(lastVowel ? all.length() : vowels.length());
  23. lastVowel = c < vowels.length();
  24. sb.append(all.charAt(c));
  25. }
  26.  
  27. System.out.println(sb);
  28. }
  29. }
Success #stdin #stdout 0.07s 380224KB
stdin
15
stdout
oderyyecydogefo