#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>
bool cmpMovies(std::pair<std::string, double>& p1, std::pair<std::string, double>& p2) {
return p1.second < p2.second;
}
int main() {
std::vector<std::pair<std::string, double>> v{
{"12 Angry Man", 8.9}
};
v.push_back(std::make_pair("The GodFather", 9.1));
v.push_back({ "The Dark Knight", 9.0 });
v.emplace_back("Pulp Fiction", 8.8);
/* ... */
std::sort(v.begin(), v.end(), cmpMovies);
for (auto& [f, s] : v) {
std::cout << f << " " << s << "\n";
}
}