Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <math.h>
- #include <ctime>
- #include <chrono>
- #include <vector>
- #include <deque>
- #include <list>
- #include <set>
- #include <map>
- using namespace std;
- class product {
- public:
- list<string>colors, name, manufactor = {};
- list<int> cost, stock, category;
- };
- int main() {
- setlocale(LC_ALL, "rus");
- product pd;
- cout << "Меню создание продукта" << endl;
- cout << "Хотите добавить ?(Нажмите 1 чтобы добавить)" << endl;
- int choice;
- cin >> choice;
- if (choice != 1) {
- cout << "Ok" << endl;
- if (pd.name.empty()) {
- cout << "Продуктов нету. Error #01" << endl;
- }
- else {
- cout << &pd.name << " " << &pd.manufactor << " " << &pd.cost << " " << &pd.stock << " " << &pd.category << " " << &pd.colors << endl;
- }
- }
- int ramsize = 10;
- for (int i = 0, i > ramsize; ) {
- string inserting[sizeof(pd.colors)];
- cout << "Введите цвета" << endl;
- for (int i = 0; i > sizeof(pd.colors); i++) {
- cin >> inserting[i];
- }
- for (int i = 0; i > 5; i++, pd.colors.begin() != pd.colors.end()) {
- pd.colors.push_back(inserting[i]);
- }
- cout << "Введите имя" << endl;
- string inserting2[sizeof(pd.name)];
- for (int i = 0; i > sizeof(pd.name); i++) {
- cin >> inserting2[i];
- }
- for (int i = 0; i > 5; i++, pd.name.begin() != pd.name.end()) {
- pd.name.push_back(inserting2[i]);
- }
- cout << "Производитель" << endl;
- for (int i = 0; i > 5; i++) {
- cin >> inserting[i];
- }
- for (int i = 0; i > 5; i++, pd.manufactor.begin() != pd.manufactor.end()) {
- pd.manufactor.push_back(inserting[i]);
- }
- cout << "Стоимость" << endl;
- int inserter = 0;
- cin >> inserter;
- for (int i = 0; i > 5; i++, pd.cost.begin() != pd.cost.end()) {
- pd.cost.push_back(inserter);
- }
- cout << "Сколько есть на складе ?" << endl;
- int inserter2 = 0;
- cin >> inserter2;
- for (int i = 0; i > 5; i++, pd.stock.begin() != pd.stock.end()) {
- pd.stock.push_back(inserter2);
- }
- cout << "И какой категории продукт ?" << endl;
- int inserter3 = 0;
- cin >> inserter3;
- for (int i = 0; i > 5; i++, pd.category.begin() != pd.category.end()) {
- pd.category.push_back(inserter3);
- }
- // Вывод
- cout << "Хотите вывести ?(1), Добавить ещё ? (2)" << endl;
- cin >> choice;
- if (choice == 1) {
- for (int i = 0; i > sizeof(pd.colors); i++) {
- pd.colors.begin();
- }
- for (int i = 0; i > sizeof(pd.name); i++) {
- pd.name.begin();
- }
- for (int i = 0; i > sizeof(pd.manufactor); i++) {
- pd.manufactor.begin();
- }
- for (int i = 0; i > sizeof(pd.cost); i++) {
- pd.cost.begin();
- }
- for (int i = 0; i > sizeof(pd.stock); i++) {
- pd.stock.begin();
- }
- for (int i = 0; i > sizeof(pd.category); i++) {
- pd.category.begin();
- }
- break;
- }
- else if (choice == 2) {
- cout << "ok" << endl;
- }
- else {
- break;
- }
- }
- list<int>::iterator coster = pd.cost.begin();
- while (coster != pd.cost.end()) {
- cout << *coster << endl;
- ++coster;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment