首页 > 其他 > 详细

struct

时间:2020-07-14 14:42:41      阅读:55      评论:0      收藏:0      [点我收藏+]
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
struct rubbish{
	int t; int l; int h;
	bool operator < (const rubbish& b) const{
        return t< b.t;  
    }
	rubbish(): l(),t(),h(){	}
	rubbish(int a,int b,int c): t(a),l(b),h(c){	}
	#define t(x) r[x].t
	#define l(x) r[x].l
	#define h(x) r[x].h
}r[101]; 
int dp[126],d,n;
int main(){
	cin>>d>>n;
	for(int i=1;i<=n;i++){
		int a,b,c;
		cin>>a>>b>>c;
		r[i]=rubbish(a,b,c);
	}
	sort(r+1,r+1+n);
	for (int i=1;i<=n;i++) cout<<t(i)<<" "<<l(i)<<" "<<h(i)<<endl; 
	return 0;
}

  

struct

原文:https://www.cnblogs.com/master-fiora/p/13298549.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!