文章
60
粉丝
361
获赞
43
访问
528.0k
1思路简单,细节很多
#include <iostream>
#include <string>
#include <string.h>
#include<algorithm>
#include <vector>
using namespace std;
struct country
{
int id;
int jin;
int yin;
int jiang;
int sum;
float jin_rat;
float jiang_rat;
int flag;
int pai[4];
int paiming;
int way;
}coun[1000];
bool compare_1(country a,country b)
{
return a.jin>b.jin;
}
bool compare_2(country a,country b)
{
return a.jiang>b.jiang;
}
bool compare_3(country a,country b)
{
return a.jin_rat>b.jin_rat;
}
bool compare_4(country a,country b)
{
return a.jiang_rat>b.jiang_rat;
}
int main()
{
int n,m;
while(cin>>n>>m)
{
int result[1000][3]={0};
//输入
for(int i=0;i<n;i++)
{
cin>>coun[i].jin ;
cin>>coun[i].yin;
cin>>coun[i].sum;
coun[i].id=i;
coun[i].flag=0;
coun[i].jiang=coun[i].jin+coun[i].yin;
coun[i].jin_rat =((float)coun[i].jin) /((float)coun...
登录后发布评论
暂无评论,来抢沙发