学生成绩 怎么输出不来
import java.util.Scanner;public class S{
public static void main(String[] args){
Scanner in = new Scanner (System.in);
System.out.println("请输入学生的个数");
int renshu = in.nextInt();//存储学生的个数
System.out.println("请输入科目的数量");
int course = in.nextInt();//存储科目的数量
String[] name = new String[renshu];//声明一个数组来存储学生的个数
String[] courseN = new String[course];
int [][] number = new int[renshu][course];
int [] sum = new int[renshu];
int [] ave = new int[renshu];
String[] str = new String[renshu];
//循环存储科目的名称
for (int i=0; i<courseN.length; i++){
System.out.println("请输入"+(i+1)+"门科目");
courseN[i] = in.next();
}
//用来录入学生各科成绩
for (int i=0; i<renshu; i++){
int S = 0;//声明一个S,表示总分
String str123 = "";
System.out.println("请输入学生的姓名");
name[i] = in.next();
for (int j=0; j<course; j++){
System.out.println("请输入"+name[i]+courseN[j]+"的成绩");
number[i][j] = in.nextInt();
S+=number[i][j];
str123 += number[i][j]+"\t";
}
sum[i] = S;//求此同学的总分存入总分数组
ave[i] = S/course;
str[i] = name[i]+"\t"+str123+"\t"+sum[i]+"\t"+ave[i];
}
for (int i=0; i<sum.length-1;i++){
for (int j=0; j<sum.length-1;i++){
if (sum[j]<sum[j+1]){
int t = sum[j]; String t2 = str[j];
sum[j] = sum[j+1]; str[j] = str[j+1];
sum[j+1] = t; str [j+1] = t2;
}
}
}
//效果输出
System.out.print("学生");
for (int i=0; i<courseN.length; i++){
System.out.print("\t"+courseN[i]);
}
System.out.print("\t总分\t平均分\t排行榜");
System.out.println();
for (int i=0; i<renshu; i++){
System.out.println(str[i]+"\t"+"第"+(i+1)+"门");
}
}
}