Untitled
unknown
plain_text
2 years ago
766 B
7
Indexable
#include <iostream> #include <vector> #include <iomanip> #include <algorithm> using namespace std; struct Film { string name; int date; string rez; bool operator< (const Film& other) const { return date < other.date; } }; int main() { int n; cin >> n; vector<Film> all; for (int i = 0; i < n; i++) { Film p; cin >> p.name >> p.date >> p.rez; all.push_back(p); } sort(all.begin(), all.end()); int k = 0; int a = -1; int g1, g2; cin >> g1 >> g2; string poisk; cin >> poisk; for (auto x : all) { if ((x.date <= g2) && (x.date >= g1) && ((x.name.find(poisk) != a))) { cout << x.name << " " << x.date << " " << x.rez << endl; k++; } } if (k == 0) { cout << "Movie not found"; } }
Editor is loading...