我打出了最大值跟最小值啊
package zh.codegym.task.task07.task0721;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
数组中的最小值和最大值
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] p =new int[20];
for(int i=0;i<20;i++){
String h = reader.readLine();
int c = Integer.parseInt(h);
p[i]=c;
}
int max=0;
int min=0;
for(int q : p){
if(q>max){
max =q;
}
}
for(int q : p){
if(q<min){
min =q;
}
}
int maximum = max;
int minimum = min;
//在此编写你的代码
System.out.print(maximum + " " + minimum);
}
}