Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num1 = 0;
- do {
- isNotCorrect = false;
- System.out.println("Введи число 1");
- try{
- num1 = Integer.parseInt(scan.nextLine());
- } catch(NumberFormatException exception) {
- isNotCorrect = true;
- }
- if ((isNotCorrect) || (num1 < 0)) {
- isNotCorrect = true;
- System.err.println("Гойда, ошибка");
- }
- } while (isNotCorrect);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement