AcWing 862. 三元组排序
原题链接
简单
作者:
Saber__
,
2024-11-05 14:06:11
,
所有人可见
,
阅读 5
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
const int N = 10000;
struct Date
{
int x;
double y;
string z;
bool operator< (const Date &t) const
{
return x < t.x;
}
}a[N];
int main()
{
int n;
cin >> n;
for(int i = 0; i< n; ++i) cin >> a[i].x >> a[i].y >> a[i].z;
sort(a,a+n);
for(int i = 0; i< n; ++i)
cout << a[i].x << ' ' << fixed<<setprecision(2) << a[i].y << ' ' << a[i].z.c_str() << endl;
return 0;
}