/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main {
public static void main
(String[] args
) { System.
out.
println("Generating name..."); int length
= new Scanner
(System.
in).
nextInt(); String consonants
= "bcdfghjklmnpqrstvwxyz"; char[][] pairs = new char[length][2];
for (char[] pair : pairs) {
pair[0] = vowels.charAt(gen.nextInt(vowels.length()));
pair[1] = consonants.charAt(gen.nextInt(consonants.length()));
}
System.
out.
println("Generated!"); System.
out.
print("The name is: "); StringBuilder name = new StringBuilder();
for (char[] pair : pairs) {
if (gen.nextBoolean()) {
name.append(pair[0]);
name.append(pair[1]);
} else {
name.append(pair[1]);
name.append(pair[0]);
}
}
if (gen.nextBoolean()) {
if (vowels.indexOf(name.charAt(name.length() - 1)) != -1) {
name.append(consonants.charAt(gen.nextInt(consonants.length())));
} else {
name.append(vowels.charAt(gen.nextInt(vowels.length())));
}
}
System.
out.
println(toDisplayCase
(name.
toString())); }
final String ACTIONABLE_DELIMITERS
= " '-/"; StringBuilder sb = new StringBuilder();
boolean capNext = true;
for (char c : s.toCharArray()) {
c = (capNext)
sb.append(c);
capNext = (ACTIONABLE_DELIMITERS.indexOf((int) c) >= 0);
}
return sb.toString();
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KcHVibGljIGNsYXNzIE1haW4gewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHsKCQlTeXN0ZW0ub3V0LnByaW50bG4oIkdlbmVyYXRpbmcgbmFtZS4uLiIpOwoJCWludCBsZW5ndGggP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