Advertisement
Soverein

Untitled

Jan 7th, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. //4. Враховуючи інформацію про предмети, вилучені на митниці за звітний
  2. //період : дата вилучення, найменування предмету, кількість одиниць, вартість,
  3. //визначити назву предмета, якого вилучено максимальну кількість разів.
  4. #include <iostream>
  5. #include <stdlib.h>
  6. #include <math.h>
  7. using namespace std;
  8. struct RI //removed items
  9. {
  10. char date[40];
  11. int name;
  12. int kil;
  13. int price;
  14.  
  15. };
  16. int main()
  17. {
  18. int n;
  19. char str[100];
  20. do
  21. {
  22. cout << "Input N>0:";
  23. cin.getline(str, 99);
  24. n = atoi(str);
  25. } while (n <= 0);
  26. RI* mas = new RI[n];
  27. for (int i = 0; i < n; ++i)
  28. {
  29. cout << "Input date:";
  30. cin.getline(mas[i].date, 40);
  31. cout << "Input name:";
  32. cin.getline(str, 40);
  33. mas[i].name = atoi(str);
  34. cout << "Input kilkist : ";
  35. cin.getline(str, 99);
  36. mas[i].kil = atoi(str);
  37. cout << "Input price:";
  38. cin.getline(str, 99);
  39. mas[i].price = atoi(str);
  40. }
  41. for (int i = 0; i < n; ++i)
  42. {
  43. cout << mas[i].date << " ";
  44. cout << mas[i].name << " ";
  45. cout << mas[i].kil << " ";
  46. cout << mas[i].price << endl;
  47. }
  48. for (int i=0;i < n;++i)
  49. if ()
  50.  
  51.  
  52.  
  53. for (int i = 0; i < n; ++i)
  54. {
  55. cout<< "Max = "<<
  56. }
  57. delete[]mas;
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement