2024-06-07 11:25:39 +04:00
|
|
|
import java.util.Scanner;
|
|
|
|
public class Program {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
Plans MyPlan = new Plans();
|
|
|
|
while (true){
|
|
|
|
System.out.println("Введите команду:");
|
|
|
|
Scanner scanner = new Scanner(System.in);
|
|
|
|
String com = scanner.nextLine();
|
|
|
|
switch (com){
|
|
|
|
case "#write":
|
|
|
|
System.out.println("Введите ваши планы на сегодня: ");
|
|
|
|
String write = scanner.nextLine();
|
|
|
|
String[] words = write.split(" ");
|
2024-06-07 16:21:20 +04:00
|
|
|
if (!MyPlan.Write(words)){
|
|
|
|
System.out.println("Строка пустая");
|
|
|
|
}
|
2024-06-07 11:25:39 +04:00
|
|
|
break;
|
|
|
|
case "#read":
|
|
|
|
MyPlan.Read();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
throw new IllegalStateException("Unexpected value: " + com);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|