文章
1
粉丝
169
获赞
1
访问
8.3k
#include <bits/stdc++.h>
using namespace std;
class country{
public:
int id;
int M_g, M;
int pop;
float averM_g, averM;
int best, method;
};
bool cmp1(country a, country b){
return a.M_g > b.M_g;
}
bool cmp2(country a, country b){
return a.M > b.M;
}
bool cmp3(country a, country b){
return a.averM_g > b.averM_g;
}
bool cmp4(country a, country b){
return a.averM > b.averM;
}
int main(){
int N, M;
while(cin>>N>>M){
int flag[N];
for(int i=0;i<N;i++)
flag[i] = 0;
country a[N];
country a1[N];
for(int i=0;i<N;i++)
cin>>a[i].M_g>>a[i].M>>a[i].pop;
for(int i=0;i<N;i++){
a[i].id = i;
a[i].averM_g = float(a[i].M_g / a[i].pop) ;
a[i].averM = float(a[i].M / a[i].pop) ;
}
//将需排名的国家存入a1中
int...
登录后发布评论
暂无评论,来抢沙发