-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
40 lines (34 loc) · 1.56 KB
/
Main.java
File metadata and controls
40 lines (34 loc) · 1.56 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
39
40
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
var scanner = new Scanner(System.in);
System.out.println("Привет, я бот, напиши /help, чтобы узнать что я умею");
while (true) {
System.out.println("Ты:");
var a = scanner.nextLine().toLowerCase();
if (a.equals("/help")) {
System.out.println("Бот: Вот что я умею:");
System.out.println("• привет - поздороваться");
System.out.println("• как дела? - спросить как дела");
System.out.println("• пока - завершить общение");
}
else if (a.equals("привет")) {
System.out.println("Бот: привет, как твои дела?");
}
else if(a.equals("нормально") || (a.equals("хорошо"))) {
System.out.println("Бот: круто");
}
else if (a.equals("как дела?")) {
System.out.println("Бот: все хорошо");
}
else if (a.equals("пока")) {
System.out.println("Бот: до встречи! Было приятно пообщаться!");
break;
}
else {
System.out.println("Бот: я не понимаю. Напиши /help для помощи");
}
}
scanner.close();
}
}