Do not judge strictly, I teach Java for the third day, I decided to create a program for the fan, after the game is over, I want the question to appear: do you want to continue or not? If the answer is yes, then the game would start anew, if the answer is no, then all the best.
import java.util.Scanner; import java.util.Random; public class Bender { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int summa; String stavka; System.out.println("Сделайте вашу ставку, вы можете поставить на красное или черное, четное или не не четное, или на определленое число."); stavka = scanner.next(); System.out.println("Какую сумму ставите?"); summa = scanner.nextInt(); for (int i = 0; i < 1; i++) { int b; String[] colour = {"Черное.", "Красное."}; Random random = new Random(); Random random1 = new Random(); int select = random.nextInt(colour.length); b = (random1.nextInt(36)); if (b == 0) { System.out.print(""); } else if ((b & 1) == 0) { System.out.print(" Выпало четное" + " "); } else { System.out.print("Выпало нечетное" + " "); } System.out.println(b + " " + colour[select]); } String otvet; int znach = 1; if (stavka.equals("Красное")) { System.out.println("Ставка сыграла, вы победили!Выиграшь составляет:" + summa * 2); } else if (stavka.equals("Черное")) { System.out.println("Ставка сыграла, вы победили!Выиграшь составляет:" + summa * 2); } else if (stavka.equals("Не четное")) { System.out.println("Ставка сыграла, вы победили!Выиграшь составляет:" + summa * 2); } else if (stavka.equals("Четное")) { System.out.println("Ставка сыграла, вы победили!Выиграшь составляет:" + summa * 2); } else System.out.println("Вы проиграли,делаем ставку еще раз?"); otvet = scanner.next(); if (otvet.equals("Да")) { System.out.println("Продолжаем!"); } else if (otvet.equals("Нет")) ; System.out.println("Жаль(До Встречи!"); } }