-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVirusLabNumber2.cpp
More file actions
49 lines (43 loc) · 1.35 KB
/
VirusLabNumber2.cpp
File metadata and controls
49 lines (43 loc) · 1.35 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
41
42
43
44
45
46
47
48
49
#include <iostream>
#include "Virus.h"
#include "InvectedItem.h"
using namespace std;
int menuSelect()
{
int choice;
while(true)
{
cout << "1)Посмотреть существующие вирусы. \n2)Добавить вирус. \n3)Посмотреть статистику на сегодняшний день.\n4)Спрогнозировать темп вируса. \n5)Выход. \n>";
// int choice;
cin >> choice;
if (cin.fail() || choice < 0 || choice>6) //Проверка ввода
{
cin.clear();
cin.ignore(32767, '\n');
cout << "Некоректный ввод. \n";
}
else
{
cin.ignore(32767, '\n');
return choice;
}
}
}
int main()
{
setlocale(LC_CTYPE, "Russian");
int choice;//для выбора пункта в меню
choice = menuSelect();
switch (choice) {
case 1: cout << "Смотрим существующие вирусы \n";
break;
case 2: cout << "Добавляем вирус \n";
break;
case 3: cout << "Смотрим статистику \n";
break;
case 4: cout << "Прогнозируем темп вируса \n";
break;
case 5: exit(0);
return 0;
}
}