冒排,脑洞太大了,呵呵
最高分与最低分之差
http://www.nowcoder.com/questionTerminal/e0e4f81dcd55408a8973f8033bbeb1d2
include<bits/stdc++.h>
using namespace std;
int a[45];
int main()
{
int n, s = 0;
cin >> n;
for(int i = 1; i <= n; i++)
{
cin >> a[i];
}
for(int i = 1; i <= n - 1; i++)
{
for(int j = 1; j <= n - i; j++)
{
if(a[j] > a[j + 1])
{
swap(a[j], a[j + 1]);
}
}
}
for(int i = 1; i <= n; i++)
{
s = a[n] - a[1];
}
cout << s << endl;
return 0;
}