Advertisement
Soverein

Untitled

Dec 28th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. using namespace std;
  5. struct RI //removed items
  6. {
  7. char date[40];
  8. int name;
  9. int kil;
  10. int price;
  11.  
  12. };
  13. int main()
  14. {
  15. int n;
  16. char str[100];
  17. do
  18. {
  19. cout << "Input N>0:";
  20. cin.getline(str, 99);
  21. n = atoi(str);
  22. } while (n <= 0);
  23. RI* mas = new RI[n];
  24. for (int i = 0; i < n; ++i)
  25. {
  26. cout << "Input date:";
  27. cin.getline(mas[i].date, 40);
  28. cout << "Input name:";
  29. cin.getline(str, 40);
  30. mas[i].name = atoi(str);
  31. cout << "Input kilkist : ";
  32. cin.getline(str, 99);
  33. mas[i].kil = atoi(str);
  34. cout << "Input price:";
  35. cin.getline(str, 99);
  36. mas[i].price = atoi(str);
  37. }
  38. for (int i = 0; i < n; ++i)
  39. {
  40. cout << mas[i].date << " ";
  41. cout << mas[i].name << " ";
  42. cout << mas[i].kil << " ";
  43. cout << mas[i].price << endl;
  44. }
  45. for (int i=0;i<n;++i)
  46.  
  47.  
  48.  
  49. for (int i = 0; i < n; ++i)
  50. {
  51. cout<< "Max = "<<
  52. }
  53. delete[]mas;
  54. return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement