import java.util.Scanner;

public class RepeatAdditionQuiz {
  public static void main(String[] args) {
    int number1 = (int)(Math.random() * 10);
    int number2 = (int)(Math.random() * 10);

    // Tworzenie obiektu typu Scanner
    Scanner input = new Scanner(System.in);

    System.out.print(
      "Ile wynosi " + number1 + " + " + number2 + "? ");
    int answer = input.nextInt();
    
    while (number1 + number2 != answer) {
      System.out.print("Błędna odpowiedź. Spróbuj ponownie. Ile wynosi "
        + number1 + " + " + number2 + "? ");
      answer = input.nextInt();
    }

    System.out.println("To poprawna odpowiedź!");
  }
}
