Input contains many lines(at least two), each line contains 1 integer number(bigger than 0) and the last line is a single '%'. Print the second large number, according to the following example.
Samples Input:
10
9
24
21
6
12
%
Samples Output:
SECOND LARGE NUMBER = 21
Samples Input:
10
9
24
21
6
12
%
Samples Output:
SECOND LARGE NUMBER = 21
echo max($a):
//返回第二大的数//数据数组
$num = array(10,9,24,21,6,12);
//数组排序
sort($num);
//输出数组
//var_dump($num);
//第一大
echo "第一大:". max($num) . "<br/>";
//名值对调
$num2 = array_flip($num);
echo "第二大:" . $num[$num2[max($num)] - 1];
Array.sort()请及时结帖。