Menedjer_Zavdany/main.cpp
2025-05-03 11:24:19 +00:00

58 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <iostream>
#include <vector>
#include "task.h"
#include <string>
using namespace std;
int main() {
vector<Task> spysok;
int vibor;
while (true) {
cout << "\n--- Меню ---\n";
cout << "1. Додати завдання\n";
cout << "2. Показати список зав дань\n";
cout << "3. Позначити завдання як виконане\n";
cout << "4. Зберегти завдання у файл\n"; // Додано
cout << "5. Завантажити завдання з файлу\n"; // Додано
cout << "6. Вийти\n";
cout << "Ваш вибір: ";
cout<<endl;
cin>>vibor;
cin.ignore(); // очищає буфер перед getline
if(vibor>0){ switch (vibor) {
case 1:
dodatyZavdannya(spysok);
break;
case 2:
pokazatySpysok(spysok);
break;
case 3:
poznachytyVykonane(spysok);
break;
case 4:
zberihytyUFile(spysok);
break;
case 5:
zavantazhytyZFile(spysok);
break;
case 6:
cout << "До побачення!" << endl;
return 0;
default:
cout << "Невірний вибір! Спробуйте ще раз." << endl;
} }else{cout << "Помилка: введіть число!" << endl;
cin.clear(); // скидає стан помилки
cin.ignore(); // очищає буфер до кінця рядка
continue; }
}
return 0;}