2019蓝桥javab组队

package javab_2019;

import java.util.Scanner;

public class 组队 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
TEAM team[] = new TEAM[21];
for(int i = 1;i<21;i++)
team[i] = new TEAM(sc.nextInt(),sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
int max = 0;int id1=0;int id2=0;int id3=0;int id4=0;int id5=0;
for(int i = 1;i<21;i++)
for(int j = 1;j<21;j++)
for(int k = 1;k<21;k++)
for(int l = 1;l<21;l++)
for(int q = 1;q<21;q++)
if(i!=j&&i!=k&&i!=l&&i!=q&&j!=k&&j!=l&&j!=q&&k!=l&&k!=q&&l!=q){
int t = team[i].g1+team[j].g2+team[k].g3+team[l].g4+team[q].g5;
if(t>max){
max = t;id1 = i;id2 = j;id3 = k;id4 = l;id5 = q;
System.out.println(max+" “+id1+” “+id2+” “+id3+” “+id4+” "+id5);
}

					}
	
	
	
	
}

}
class TEAM{
int id;
int g1;
int g2;
int g3;
int g4;
int g5;
public TEAM(int id,int g1,int g2,int g3,int g4,int g5){
this.id = id;
this.g1 = g1;
this.g2 = g2;
this.g3 = g3;
this.g4 = g4;
this.g5 = g5;

}

}
//
//1 97 90 0 0 0
//2 92 85 96 0 0
//3 0 0 0 0 93
//4 0 0 0 80 86
//5 89 83 97 0 0
//6 82 86 0 0 0
//7 0 0 0 87 90
//8 0 97 96 0 0
//9 0 0 89 0 0
//10 95 99 0 0 0
//11 0 0 96 97 0
//12 0 0 0 93 98
//13 94 91 0 0 0
//14 0 83 87 0 0
//15 0 0 98 97 98
//16 0 0 0 93 86
//17 98 83 99 98 81
//18 93 87 92 96 98
//19 0 0 0 89 92
//20 0 99 96 95 81

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值