Advertisement
myloyo

10.2.7

Dec 17th, 2022 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <fstream>
  4. #include <string>
  5.  
  6. using namespace std;
  7. struct point {
  8.     string mark, fam, num;
  9.     int year, prob;
  10. };
  11. ifstream in("input.txt");
  12. ofstream out("output.txt");
  13.  
  14. int main()
  15. {
  16.     int y, n;
  17.     in >> y >> n;
  18.     point t, a[51];
  19.     for (int i = 0; i < n; i++) {
  20.         in >> a[i].mark >> a[i].num >> a[i].fam >> a[i].year >> a[i].prob;
  21.     }
  22.     for (int i = 0; i < n; i++) {
  23.         if (a[i].year <= y) {
  24.             out << a[i].mark << " " << a[i].num << " " << a[i].fam << " "<< a[i].year << " "<< a[i].prob;
  25.             out << endl;
  26.         }
  27.     }
  28.     return 0;
  29. }
  30. 2020 6
  31. Honda 1ddd98 ivanov 2012 20000
  32. Mazda 2xyz55 rustik 2013 15111
  33. Wolksvagen 5jkl87 ararat 2021 51515
  34. chevrolet 6ytr14 kiseleva 2023 15124
  35. honda 9hfg25 holod 2024 32232
  36. cherry h657df beregnoi 2019 5165165
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement