JAVA编程题求高手帮忙!
来源:百度知道 编辑:UC知道 时间:2024/05/24 02:03:19
功能完成,健壮性不强,楼主可以在修改下
参考代码
================================================
package test;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class ScoreTable {
private ArrayList<Node> table=new ArrayList<Node>();
private float max=Float.MIN_VALUE,min=Float.MAX_VALUE,ave=0;
private Node[] top3=new Node[3];
public void read() throws IOException{
String s=null;
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
do{
s=in.readLine();
if(s!=null && s.length()!=0){
System.out.println("["+s+"]"+s.length());
String[] tmp=s.split(" ");
System.out.println("len:"+tmp.length);
table.add(new Node(tmp[0],tmp[1],Float.