package C; import java.util.*; public class maxandmin { public static void main(String[] args){ Scanner out = new Scanner(System.in); int[] arr =new int[3]; for(int j = 0;j < 3;j++){ System.out.println("请输入一个数"); arr[j] =out.nextInt(); } int max = arr[0]; int min = arr[0]; for(int i = 1;i < 3;i++){ if(max < arr[i]){ max = arr[i]; } if(min > arr[i]){ min = arr[i]; } } System.out.println("最大值:"+max); System.out.println("最小值:"+min); } }