#16373. 查找数组中的最大值、最小值
查找数组中的最大值、最小值
说明
从键盘上读入n个整数,从这n个整数中找出最大值和最小值,以及最大值和最小值的位置。输入格式
第一行一个整数n(n<100);第二行n个以空格相隔的整数(每个数在[1,1000])。
输出格式
第一行最大值和最大值的位置,它们之间以空格相隔;第二行最小值和最小值的位置,它们之间以空格相隔;
5
5 3 6 2 46 3
2 4
5
5 3 6 2 46 3
2 4
By signing up a 算道OJ universal account, you can submit code and join discussions in all online judging services provided by us.