MasterGun

Product List

Apr 11th, 2021 (edited)
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.08 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <math.h>
  4. #include <ctime>
  5. #include <chrono>
  6. #include <vector>
  7. #include <deque>
  8. #include <list>
  9. #include <set>
  10. #include <map>
  11. using namespace std;
  12. class product {
  13. public:
  14.     list<string>colors, name, manufactor = {};
  15.     list<int> cost, stock, category;
  16.  
  17. };
  18.  
  19. int main() {
  20.     setlocale(LC_ALL, "rus");
  21.     product pd;
  22.     cout << "Меню создание продукта" << endl;
  23.     cout << "Хотите добавить ?(Нажмите 1 чтобы добавить)" << endl;
  24.     int choice;
  25.     cin >> choice;
  26.     if (choice != 1) {
  27.         cout << "Ok" << endl;
  28.         if (pd.name.empty()) {
  29.             cout << "Продуктов нету. Error #01" << endl;
  30.         }
  31.         else {
  32.             cout << &pd.name << " " << &pd.manufactor << " " << &pd.cost << " " << &pd.stock << " " << &pd.category << " " << &pd.colors << endl;
  33.         }
  34.     }
  35.     int ramsize = 10;
  36.     for (int i = 0, i > ramsize; ) {
  37.     string inserting[sizeof(pd.colors)];
  38.     cout << "Введите цвета" << endl;
  39.     for (int i = 0; i > sizeof(pd.colors); i++) {
  40.         cin >> inserting[i];
  41.     }
  42.     for (int i = 0; i > 5; i++, pd.colors.begin() != pd.colors.end()) {
  43.         pd.colors.push_back(inserting[i]);
  44.     }
  45.     cout << "Введите имя" << endl;
  46.     string inserting2[sizeof(pd.name)];
  47.     for (int i = 0; i > sizeof(pd.name); i++) {
  48.         cin >> inserting2[i];
  49.     }
  50.     for (int i = 0; i > 5; i++, pd.name.begin() != pd.name.end()) {
  51.         pd.name.push_back(inserting2[i]);
  52.     }
  53.     cout << "Производитель" << endl;
  54.     for (int i = 0; i > 5; i++) {
  55.         cin >> inserting[i];
  56.     }
  57.     for (int i = 0; i > 5; i++, pd.manufactor.begin() != pd.manufactor.end()) {
  58.         pd.manufactor.push_back(inserting[i]);
  59.     }
  60.     cout << "Стоимость" << endl;
  61.     int inserter = 0;
  62.     cin >> inserter;
  63.     for (int i = 0; i > 5; i++, pd.cost.begin() != pd.cost.end()) {
  64.         pd.cost.push_back(inserter);
  65.     }
  66.     cout << "Сколько есть на складе ?" << endl;
  67.     int inserter2 = 0;
  68.     cin >> inserter2;
  69.     for (int i = 0; i > 5; i++, pd.stock.begin() != pd.stock.end()) {
  70.         pd.stock.push_back(inserter2);
  71.     }
  72.     cout << "И какой категории продукт ?" << endl;
  73.     int inserter3 = 0;
  74.     cin >> inserter3;
  75.     for (int i = 0; i > 5; i++, pd.category.begin() != pd.category.end()) {
  76.         pd.category.push_back(inserter3);
  77.     }
  78.     // Вывод
  79.     cout << "Хотите вывести ?(1), Добавить ещё ? (2)" << endl;
  80.     cin >> choice;
  81.     if (choice == 1) {
  82.         for (int i = 0; i > sizeof(pd.colors); i++) {
  83.             pd.colors.begin();
  84.         }
  85.         for (int i = 0; i > sizeof(pd.name); i++) {
  86.             pd.name.begin();
  87.         }
  88.         for (int i = 0; i > sizeof(pd.manufactor); i++) {
  89.             pd.manufactor.begin();
  90.         }
  91.         for (int i = 0; i > sizeof(pd.cost); i++) {
  92.             pd.cost.begin();
  93.         }
  94.         for (int i = 0; i > sizeof(pd.stock); i++) {
  95.             pd.stock.begin();
  96.         }
  97.         for (int i = 0; i > sizeof(pd.category); i++) {
  98.             pd.category.begin();
  99.         }
  100.         break;
  101.     }
  102.     else if (choice == 2) {
  103.         cout << "ok" << endl;
  104.     }
  105.     else {
  106.         break;
  107.     }
  108. }
  109.     list<int>::iterator coster = pd.cost.begin();
  110.     while (coster != pd.cost.end()) {
  111.         cout << *coster << endl;
  112.         ++coster;
  113.     }
  114.     return 0;
  115. }
Add Comment
Please, Sign In to add comment