Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //4. Враховуючи інформацію про предмети, вилучені на митниці за звітний
- //період : дата вилучення, найменування предмету, кількість одиниць, вартість,
- //визначити назву предмета, якого вилучено максимальну кількість разів.
- #include <iostream>
- #include <stdlib.h>
- #include <math.h>
- using namespace std;
- struct RI //removed items
- {
- char date[40];
- int name;
- int kil;
- int price;
- };
- int main()
- {
- int n;
- char str[100];
- do
- {
- cout << "Input N>0:";
- cin.getline(str, 99);
- n = atoi(str);
- } while (n <= 0);
- RI* mas = new RI[n];
- for (int i = 0; i < n; ++i)
- {
- cout << "Input date:";
- cin.getline(mas[i].date, 40);
- cout << "Input name:";
- cin.getline(str, 40);
- mas[i].name = atoi(str);
- cout << "Input kilkist : ";
- cin.getline(str, 99);
- mas[i].kil = atoi(str);
- cout << "Input price:";
- cin.getline(str, 99);
- mas[i].price = atoi(str);
- }
- for (int i = 0; i < n; ++i)
- {
- cout << mas[i].date << " ";
- cout << mas[i].name << " ";
- cout << mas[i].kil << " ";
- cout << mas[i].price << endl;
- }
- for (int i=0;i < n;++i)
- if ()
- for (int i = 0; i < n; ++i)
- {
- cout<< "Max = "<<
- }
- delete[]mas;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement