第一题:
读题:
给定n个数,从中选出m个数,使得这些数中的最大值与最小值差最小
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
思路:
先输入这些数据,再排序,这样能够保证连续的m个数中最大值与最小值之差尽可能小,再擂台找到这些的最小值
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
代码:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------