nyoj-8
来源:互联网 发布:mac sublime 跳转 编辑:程序博客网 时间:2024/05/01 08:42
#include<iostream>#include<algorithm>#include<fstream>using namespace std;#define N 1024struct node{int id,a,b;}s[N];bool cmp(node x,node y){if(x.id<y.id)return true;if(x.id==y.id && x.a<y.a)return true;if(x.id==y.id && x.a==y.a && x.b==y.b)return true;return false;//这个一定要写,不然一定会错误的。这里没有考虑清楚。}int main(){//fstream cin("d:\\test.txt");int t;cin>>t;while(t--){int n,i;cin>>n;for(i=0;i<n;++i){cin>>s[i].id>>s[i].a>>s[i].b;if(s[i].a<s[i].b){int temp=s[i].a;s[i].a=s[i].b;s[i].b=temp;}}sort(s,s+n,cmp);cout<<s[0].id<<" "<<s[0].a<<" "<<s[0].b<<endl;for(i=1;i<n;++i){if(s[i].id==s[i-1].id && s[i].a==s[i-1].a && s[i].b==s[i-1].b)continue;cout<<s[i].id<<" "<<s[i].a<<" "<<s[i].b<<endl;}}return 0;}
- nyoj-8
- nyoj 8
- NYOJ-8
- NYOJ 8 一种排序
- NYOJ 8 一种排序
- NYOJ 8 一种排序
- NYOJ 8-一种排序
- NYOJ,8,一种排序
- NYOJ--8--一种排序
- nyoj-8-一种排序
- nyoj 8 一种排序
- 一种排序NYOJ 8
- NYOJ 8 一种排序
- NYOJ 8 一种排序
- 一种排序(nyoj 8)
- NYOJ 8 一种排序
- NYOJ 8 一种排序
- nyoj 8 一种排序
- nyoj-96
- Android面试题(五)
- nyoj-569
- nyoj-5
- nyoj-6
- nyoj-8
- poj-1088 & nyoj-10
- windows多线程编程
- nyoj-11
- nyoj-73
- nyoj-13
- nyoj-12
- nyoj-14
- nyoj-74