java作足球联赛积分管理系统(足球比赛积分排行榜程序)

用java编写小程序,已知a、b、c 3个队伍进行足球比赛,胜利3记分,平局1分,输0分

import java.util.Collections;import java.util.HashMap;import java.util.LinkedList;import java.util.List;import java.util.Map;public class Test {    public static void main(String[] args) {        final String[] str = { “a-b 1:1”, “a-c 2:1”, “b-c 0:1″ };                final Map map = new HashMap();        for (String s : str) {            final String[] temp = s.split(” “);            final String[] names = temp[0].split(“-“);            final String[] counts = temp[1].split(“:”);            for (int i = 0; i < 2; i++) {                String name = names[i];                int count = Integer.parseInt(counts[i]);                if (map.containsKey(name)) {                    map.put(name, map.get(name) + count);                } else {                    map.put(name, count);                }            }        }                final List teams = new LinkedList();        for (String name : map.keySet()) {            teams.add(new Team(name, map.get(name)));        }        Collections.sort(teams);        System.out.println(“队伍 : 分”);        for (Team t : teams) {            System.out.println(t.getName() + ”   : ” + t.getCount());        }    }}class Team implements Comparable {    private String name;    private int count;    public Team(String name, int count) {        this.name = name;        this.count = count;    }    public void addCount(int count) {        this.count = this.count + count;    }    public String getName() {        return name;    }    public int getCount() {        return count;    }    public int compareTo(Team o) {        return o.getCount() – this.count;    }}

java射击世界杯足球赛成绩统计

import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.event.*;import javax.swing.table.*;import java.sql.*;public class BrowseJFrame extends JFrame implements ListSelectionListener{ private DataBaseOperation dboper; //操纵数据库的对象 private String table; //数据库中的表名 private String[] columnNames; //指定表中所有列的中文标题 private String list_column; //表中的列 private String sort_column; //指定排序依据的列 private JList list_group;//列表框,显示分类列的不重复值 private JTable table_team; //表格组件,显示数据库中指定的内容 private DefaultTableModel tableModel; //JTable使用的模式 public BrowseJFrame(DataBaseOperation dboper, String table, String[] columnNames, String list_column, String sort_column) //构造方法,指定表名 { this.dboper = dboper;this.table = table; this.columnNames = columnNames; this.list_column = list_column; this.sort_column = sort_column; this.setSize(640,240); //界面设计 this.setLocation(300,240); this.setDefaultCloseOperation(EXIT_ON_CLOSE);JSplitPane splitter_h = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);//分割窗格,水平分割 this.add(splitter_h); try {String[] groupdata = dboper.selectDistinct(table, list_column);//获得指定列不重复的值this.list_group = new JList(groupdata); this.list_group.setSelectedIndex(1);//选中第1项splitter_h.add(new JScrollPane(this.list_group));this.list_group.addListSelectionListener(this); //注册选择事件监听器tableModel = new DefaultTableModel(columnNames,0); //默认表格模式this.valueChanged(null);//执行列表框的选择事件处理程序this.table_team = new JTable(tableModel); //this.table_team.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);splitter_h.add(new JScrollPane(table_team)); } catch(Exception e) {e.printStackTrace(); } this.setVisible(true); } public void display(String columnValue) { String conditions=””; if(columnValue!=null && !columnValue.equals(“全部”)) conditions = this.list_column + ” = ‘”+columnValue+”‘”; try {dboper.select(this.table, conditions, sort_column, this.tableModel); //查询并显示指定组的数据结果集 } catch(SQLException sqle) {sqle.printStackTrace(); } }public void valueChanged(ListSelectionEvent e)//在列表框中选择数据项时触发 {//在表中查询指定组的数据,将数据结果集显示在表格组件中 String selecteditem = (String)list_group.getSelectedValue(); if(selecteditem!=null) display(selecteditem); }public static void main(String args[]) { String driver = “com.microsoft.jdbc.sqlserver.SQLServerDriver”; //指定SQL Server JDBC驱动程序 String url = “jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=WorldCup2006”; //指定SQL Server数据库student的URL String user = “sa”; //指定用户名 String password = “yeheya”;//指定用户口令 try {DataBaseOperation dboper = new DataBaseOperation(driver,url,user,password);String[] team_columnNames={“组别”,”球队1″,”球队2″,”场次”,”比赛时间”,”队1进球数”,”队2进球数”};BrowseJFrame team_browse = new BrowseJFrame(dboper,”MatchRecord”, team_columnNames, “group1”, “number”);team_browse.setTitle(“第18届世界杯足球赛 小组赛记录表(赛程安排及战况记录)2006年6月9日~7月10日 德国”);} catch(Exception e) {e.printStackTrace(); } }}/*//小组赛记录表//小组赛积分榜String[] team_columnNames={“排名”,”组别”,”球队”,”国旗”,”场次”,”胜”,”平”,”负”,”进球”,”失球”,”净胜球”,”积分”};BrowseJFrame team_browse = new BrowseJFrame(dboper,”TeamScore”, team_columnNames, “group1”, “rank”);team_browse.setTitle(“第18届世界杯足球赛 小组赛积分榜”);public void valueChanged(ListSelectionEvent e)//在列表框中选择数据项时触发 {//在表中查询指定组的数据,将数据结果集显示在表格组件中 String selecteditem = (String)list_group.getSelectedValue(); String conditions = this.list_column + ” = ‘”+selecteditem+”‘”; try {dboper.select(this.table, conditions, sort_column, this.dataModel); //查询并显示指定组的数据结果集 } catch(SQLException sqle) {sqle.printStackTrace(); } }*/有点东西需要发给你

需要一个足球联赛信息管理系统,高分求助!

好像没得听说有这种免费的软件或者网站程序。我们之前,都是人工excel统计……好累的诶。也推荐使用 ChinaGo加油中国社区 也很不错的一个体育团队平台。长春瑞莱克斯足球队。

用c++编足球联赛积分系统

本人需要一个足球联赛系统,主要功能是如下: 20支球队双循环共38轮比赛,胜好像没得听说有这种免费的软件或者网站程序。 我们之前,都是人工excel统计…

哪里有足球联赛积分榜的制作软件,越简单越好200

要WEB的吗?如果是可执行文件的话我可以,QQ:513669075

没有账号? 注册  忘记密码?