public class SL4 {
public boolean a(int[] q) {
boolean e = false;
int w = 0;
// q=input.nextInt();
for (int i = 0; i < q.length; i++) {
if (w < q[i]) {
w = q[i];
e = true;
// break;
}
}
System.out.println("最大值是" + w);
return e;
}
}
public class SL41 {
public boolean a(int[] d) {// 数组类型就要声明一个数组类型的参数
boolean f = false;
double zong = 0.0;
for (int i = 0; i < d.length; i++) {
zong += d[i];
}
System.out.println("平均分是" + (zong / 5));
return f;
}
}
public class SL42 {
public boolean d(int[] n) {
boolean g = false;
int xiao = n[0];
for (int i = 0; i < n.length; i++) {
if (xiao > n[i]) {
xiao = n[i];
}
}
System.out.println("最小值" + xiao);
return g;
}
}
import java.util.Scanner;
public class SJ42 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
SL4 a = new SL4();
SL41 b = new SL41();
SL42 c = new SL42();
int[] shu = new int[5]; // 数组类型就要声明一个数组类型
System.out.println("请输入五个数:");
for (int i = 0; i < 5; i++) {// 输入五遍的循环
shu[i] = input.nextInt();
}
a.a(shu);
b.a(shu);
c.d(shu);
}
}