private static void p5 ()
{
int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 19 };
int min = Integer.MAX_VALUE;
int max = Integer.MIN_VALUE;
for ( int i = 0; i < arr.length; i++ )
{
int ai = arr[i];
if (ai > max)
{
max = ai;
}
if (ai < min)
{
min = ai;
}
}
System.out.println ("最大值:" + max + ", 最小值: " + min);
}