编写一个简单的学生成绩斐然录入程序,要求从键盘输入人数。然后依次输入每个学生的英语,计算机语言和数据库基础的成绩,最后将输入的学生成绩信息全部显示在屏幕上。怎么写啊?帮帮忙!急啊

解决方案 »

  1.   

    不是吧,要是只有这样的话,弄的list不就搞定了嘛
      

  2.   

    用:BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    这个就是接收从键盘输入的信息,然后你吧接收到的东西处理一下就可以了
      

  3.   

    翻到以前一个程序,是计算5个学生的成绩,然后再计算总成绩的和,之后打印在一个文本文件里面:public class ScoreTest {
    private String[] name = new String[5];   //姓名
    private double[] score = new double[5];  //学分
    private double[] sum = new double[5] ;  //学分的总成绩和

    public void input() throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    boolean change = true ;
    while(change){
     try{
    for(int i = 0 ; i <= 4 ; i++){
    System.out.println("please input name:");
    name[i] = br.readLine();
    for(int k = 0 ; k <= 2 ; k ++){
    System.out.println("please input"+ i + "score");
    score[k] = Integer.parseInt(br.readLine());
    }
    System.out.println();
    sum[i] = score[0]+score[1]+score[2];
    }
    change = false;
    }catch(NumberFormatException e){
    System.out.println("Sorry,The Score only can input a number,Please input again");
    }
    }
    }
    public void compositor() throws IOException{
    FileWriter fw = new FileWriter("F://stud.txt");
    BufferedWriter bw =new BufferedWriter(fw);
    double temp1 ;
    String temp2 ;
    for(int i = 0 ; i < 4 ; i++){
    for(int j = 1 ; j < 5-i ; j ++){
    if(sum[j-1] > sum[j]){
                        temp1 = sum[j];
                        sum [j] = sum[j-1];
                        sum[j-1] = temp1;
                        temp2 = name[j];
                        name[j] = name[j-1];
                        name[j-1] = temp2;
                    }
                }
            }
            for(int i = 0;i <= 4;i++){
                bw.write(name[4-i]);
                bw.write(" "+sum[4-i]);
                bw.newLine();
            }
            bw.close();
        }
        
        public static void main(String[] args) throws IOException{
            Score s = new Score();
            s.input();
            s.compositor();
        }
    }
      

  4.   

    public class test { /**        
     *
     * @author 
     * @version 2010-4-29  上午10:25:40
     * @param args
     */
    public static void main(String[] args) {
    StringBuffer list = new  StringBuffer("姓名      英语      计算机       数据库\n");
    while (true) {
       System.out.println("please input a proper integer:");
       BufferedReader br = new BufferedReader(new InputStreamReader(
         System.in)); 
       try {
       String read = br.readLine();
       if(read.equals("q"))
       {
       break;
       }
       String[] s = read.split(" ");
       list.append(s[0]+"   "+s[1]+"   "+s[2]+"   "+s[3]+"\n");    } catch (IOException e) {
    e.printStackTrace();
       }
    }
    System.out.println(list.toString());
    }
    }
      

  5.   

    scanner sc = new Scanner (System.in) ;
    int renshu = sc.nextInt();
    int [] chengji = new int [renshu];
    然后遍历 最简单的的思路 因为我也才学没多长时间爱你