#BJSC061. 求极差
求极差
求极差
题目描述
给出 n和 n个整数 a_i,求这 n个整数中的极差是什么。极差的意思是一组数中的最大值减去最小值的差。
输入格式
第一行一个正整数 n;第二行 n 个整数。
输出格式
输出最大值与最小值之差。
样例
5
3 1 4 1 5
4
来源
BJSC
给出 n和 n个整数 a_i,求这 n个整数中的极差是什么。极差的意思是一组数中的最大值减去最小值的差。
第一行一个正整数 n;第二行 n 个整数。
输出最大值与最小值之差。
5
3 1 4 1 5
4
BJSC
By signing up a 趣信奥 universal account, you can submit code and join discussions in all online judging services provided by us.