Run ID:3301
提交时间:2024-05-04 21:09:55
#include<bits/stdc++.h> using namespace std; struct rectangle{ int id,lenth,width; void input(){ cin>>id>>lenth>>width; }void output(){ cout<<id<<" "<<lenth<<" "<<width<<endl; } }rec[1000]; bool cmp(rectangle a,rectangle b){ if(a.id!=b.id) return a.id<b.id; else if(a.lenth!=b.lenth) return a.lenth<b.lenth; else return a.width<b.width; } int main(){ int n; cin>>n; for(int i=0;i<n;i++) rec[i].input(); sort(rec,rec+n,cmp); for(int i=0;i<n;i++) if(i==0||rec[i-1].id!=rec[i].id||rec[i-1].lenth!=rec[i].lenth||rec[i-1].width!=rec[i].width) rec[i].output(); return 0; }