java5个人4项单循环比赛,每项决胜者得2分,平分各得一分,败者不得分,总分高着获胜的源代码
程序运行截图:
1.单循环赛,是所有参加比赛的队均能相遇一次
2.运动员类Sportsman
3.运动项目类SportsEvents
4.运动场地类PlayingField
5.测试类
运动员类
/**
* 运动员
*
*/
public class Sportsman {
int ID;
String name;
Map map;// 参赛项目
int totalScore;// 总得分
public Sportsman(int ID, String name) {
this.ID = ID;
this.name = name;
// 默认参加所有四场赛事
this.map = new HashMap();
map.put(0, new SportsEvents(0, "项目1"));
map.put(1, new SportsEvents(1, "项目2"));
map.put(2, new SportsEvents(2, "项目3"));
map.put(3, new SportsEvents(3, "项目4"));