Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale>
- #include <stdlib.h>
- #include <time.h>
- #include <iomanip>
- using namespace std;
- struct chancery_shop
- {
- char name[30];
- int price;
- int amount;
- char group_of_product[40];
- };
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int a;
- chancery_shop *shop;
- do
- {
- cout << "Количество товара на складе ";
- cin >> a;
- } while (a <= 0);
- shop = new chancery_shop[a];
- cout << "Ввод информации о товарах " << endl;
- cout << endl;
- for (int i = 0; i < a; i++)
- {
- cout << "Название ";
- cin >> shop[i].name;
- cout << "Цена ";
- cin >> shop[i].price;
- cout << "Количество ";
- cin >> shop[i].amount;
- cout << "Вид товара ";
- cin >> shop[i].group_of_product;
- }
- cout << "+----------+------+------------+-------------+" << endl;
- cout << "|Название |Цена |Количество |Вид товара |" << endl;
- cout << "+----------+------+------------+-------------+" << endl;
- for (int i = 0; i < a; i++)
- {
- cout << "|" << setw(10) << shop[i].name << "|" << setw(6) << shop[i].price << "|" << setw(12) << shop[i].amount << "|" << setw(13) << shop[i].group_of_product << "|"<< endl;
- cout << "+----------+------+------------+-------------+" << endl;
- }
- delete[] shop;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement