日期:2014-05-20 浏览次数:20777 次
import java.util.Scanner;
public class Student {
private String name;
private int score;
public static void main(String[] args) {
Student[] student=new Student[20];
Scanner input=new Scanner(System.in);
for(int i=0;i<student.length;i++){
System.out.println("请输入第"+(i+1)+"个学生的姓名:");
student[i].name=input.next();
System.out.println("请输入第"+(i+1)+"个学生的成绩:");
student[i].score=input.nextInt();
}
}
}
Student[] student=new Student[20];
for(int i=0;i<student.length;i++){
student[i] = new student();
}