计算整型数组中的最大值

来源:互联网 发布:软件小站解压密码 编辑:程序博客网 时间:2024/06/18 14:14
import java.util.Scanner;

public class scoreAverage {

public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int []score=new int[3];
for(int i=0;i<3;i++){
score[i]=scanner.nextInt();
}
double sum=0;
int temp=0;
for(int i=0;i<3;i++){

if(score[i]>temp){

temp=score[i];
}

}
System.out.print(temp);


}


}
原创粉丝点击