-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
79 lines (73 loc) · 1.92 KB
/
main.cpp
File metadata and controls
79 lines (73 loc) · 1.92 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include<iostream>
#include<fstream>
#include "cosmet.hpp"
using namespace std;
int main(int argc,char*argv[]){
char*namefile;
if(argc > 1)
namefile = argv[1];
else{
cout << "Не задано имя файла" << endl;
return 1;
}
for(;;){
int b;
system("clear");
cout << "Здравствуй пользователь!\n Выбери действие:" <<endl;
cout << "1 - Посмотреть товары на полке" << endl;
cout << "2 - Добавить товар на полку" << endl;
cout << "3 - Удалить товар с полки"<< endl;
cout << "4 - Найти продукт на полке(по названию)"<< endl;
cout << "5 - Изменить количество продукта на полке"<< endl;
cout << "6 - Выход"<< endl;
cin >> b;
if(b<1 || b>6)
cout << "NO! Select an item from the menu!" << endl;
while(b==1){
system("clear");
chten(namefile);
cout << "0-Return to the menu"<<endl;
cin >>b ;
if(b<0 || b>0)
cout << "NO! Select an item from the menu!" << endl;
}
while(b==2){
system("clear");
change(namefile);
chten(namefile);
cout << "\n0-Return to the menu"<<endl;
cin >>b ;
if(b<0 || b>0)
cout << "NO! Select an item from the menu!" << endl;
}
while(b==3){
system("clear");
deletes(namefile);
chten(namefile);
cout << "0-Return to the menu"<<endl;
cin >>b ;
if(b<0 || b>0)
cout << "NO! Select an item from the menu!" << endl;
}
while(b==4){
system("clear");
poisk(namefile);
cout << "0-Return to the menu"<<endl;
cin >> b ;
if(b<0 || b>0)
cout << "NO! Select an item from the menu!" << endl;
}
while(b==5){
system("clear");
change1(namefile);
chten(namefile);
cout << "0-Return to the menu"<<endl;
cin >> b ;
if(b<0 || b>0)
cout << "NO! Select an item from the menu!" << endl;
}
while(b==6){
return 0;
}
}
}