package classwork;
import java.util.*;

public class sore {

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
/**
 * @param args
 */
public static void main(String[] args) {
    // TODO Auto-generated method stub
    int StudentSore[];
    int i,Maxsore,Minsore;
    StudentSore = new int[4];
    Scanner Student = new Scanner(System.in);
    System.out.println("请输入四个学生的成绩:");
    for(i=0;i<4;i++){
        StudentSore[i] = Student.nextInt();
    
    }
    for(i=0;i<4;i++){
        System.out.println(StudentSore[i]);
    
    }
    for(i=3;i>-1;i--){
        System.out.println(StudentSore[i]);
            
    }
    for(i=0,Maxsore=StudentSore[0];i<4;i++){
        if(StudentSore[i]>Maxsore) Maxsore=StudentSore[i];
    }
    for(i=0,Minsore=StudentSore[0];i<4;i++){
        if(StudentSore[i]<Minsore) Minsore=StudentSore[i];
    }
    System.out.println("最高分为:"+Maxsore);
    System.out.println("最低分为:"+Minsore);
}

}

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄