forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGests.java
More file actions
23 lines (21 loc) · 765 Bytes
/
Gests.java
File metadata and controls
23 lines (21 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class Gests {
public static int guestNumber;
public static void Gest() {
Scanner scanner = new Scanner(System.in);
System.out.println("На какое количество человек разделить счет?");
guestNumber = 0;
while(true)
if (scanner.hasNextInt()) {
guestNumber = scanner.nextInt();
if (guestNumber <= 1) {
System.out.println("Слишком маленькое число попробуйте еще");
} else {
return;
}
}else{
System.out.println("Это не число");
scanner.nextLine();
}
}
}