public class Test {
public static void main(String[] args){
//程序说明:找出分数最高的学生
//提示用户输入
System.out.print("Enter the number of students:");
Scanner input = new Scanner(System.in);
int n = input.nextInt();
String str = "",strh = "";
double score = 0,high = 0;
//输入学生信息
int i = 1;
while(i <= n)
{
System.out.print("Enter the name of the student:");
str = input.next();
System.out.print("Enter the score of the student:");
score = input.nextDouble();
if(score > high)
{
high = score;
strh = str;
}
i++;
}
//显示分数最高的学生
System.out.print("name of the top student:" + strh + "."+ "score of the top student:" + high);
}
}