forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
39 lines (33 loc) · 1.34 KB
/
Main.java
File metadata and controls
39 lines (33 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.Scanner;
// dev branch for Y.Practicum
public class Main {
public static void main(String[] args) {
System.out.println("Привет Мир");
System.out.println("На сколько гостей делить счет?");
calculator.Produkti();
}
public static int novPersoni () {
// ваш код начнется здесь
Scanner scanner = new Scanner(System.in);
// вы не должны ограничиваться только классом Main и можете создавать свои классы по необходимости
int ludi = 0;
while (true) {
if (scanner.hasNextInt()) {
ludi= scanner.nextInt();
if (ludi==1){
System.out.println("Зачем делить?");
} else if (ludi<1){
System.out.println("совсем не то");
} else if (ludi>1){
System.out.println("наконец то, начнем считать!");
break;}
}
else {
System.out.println("Введите число");
scanner.next();
}
System.out.println("Попробуем еще");
}
return ludi;
}
}