Advertisement
Guest User

ДляАндрея

a guest
Apr 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. struct stek {
  8.     int id , count;
  9.     float weight;
  10.     stek *next=NULL;
  11. };
  12.  
  13. void vvod(stek **inf)
  14. {
  15.     stek *p = new stek;
  16.     cin >> p->id >> p->count >> p->weight;
  17.     p->next = *inf;
  18.     *inf = p;
  19. }
  20. void edit(stek **inf)
  21. {//первый пункт
  22.     stek *p = *inf;
  23.     int idsearch;
  24.     cin >> idsearch;
  25.     while (p)
  26.     {
  27.         if (idsearch == p->id)
  28.         {
  29.             cin >> p->id >> p->count >> p->weight;
  30.             return;
  31.         }
  32.         p = p->next;
  33.     }
  34. }
  35.  
  36. void show(stek **inf)
  37. {// второй пункт
  38.     stek *p = *inf;
  39.     while (p)
  40.     {
  41.         cout << p->id <<" "<< p->count <<" "<< p->weight<<" " << endl;
  42.         p = p->next;
  43.     }
  44. }
  45.  
  46. bool task(stek **inf)
  47. {// третий пункт
  48.     stek *p = *inf;
  49.     while (p)
  50.     {
  51.         if (p->count == 1 && p->weight >= 30) return true;
  52.         p = p->next;
  53.     }
  54.     return false;
  55. }
  56.  
  57. int main()
  58. {
  59.     stek *inf = NULL;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement