public class PhraseOMatic2 { public static void main (String[] args) { String[] wordListOne = {"30000-килограммовый", "умопомрачительный", "няшный"}; String[] wordListTwo = {"трансцендентный", "великорусский"}; String[] wordListThree = {"КРЫМНАШ", "ябатинг", "пук"}; int oneLength = wordListOne.length; int twoLength = wordListTwo.length; int threeLength = wordListThree.length; int rand1 = (int) (Math.random() * oneLength); int rand2 = (int) (Math.random() * twoLength); int rand3 = (int) (Math.random() * threeLength); String phrase = wordListOne[rand1] + " " + wordListTwo[rand2] + " " + wordListThree[rand3]; while (phrase != wordListOne[0] + " " + wordListTwo[1] + " " + wordListThree[2]) { System.out.println("Всё, что на нужно - это " + phrase); int rand4 = (int) (Math.random() * oneLength); int rand5 = (int) (Math.random() * twoLength); int rand6 = (int) (Math.random() * threeLength); phrase = wordListOne[rand4] + " " + wordListTwo[rand5] + " " + wordListThree[rand6]; } } }