C++ 代码
#include <iostream>
#include <map>
using namespace std;
int main()
{
int n;
int a;
double b;
string c;
cin >> n;
map<int, pair<double, string>> mm;
for(int i = 0; i < n; ++ i) {
cin >> a >> b >> c;
mm[a] = {b, c};
}
for(auto& x : mm)
printf("%d %.2f %s\n", x.first, x.second.first, x.second.second.c_str());
return 0;
}