题解 | #最高分与最低分之差#
最高分与最低分之差
http://www.nowcoder.com/practice/e0e4f81dcd55408a8973f8033bbeb1d2
#include #include #include using namespace std;
int main() { vector v; int n,score; cin>>n; for(int i=1;i<=n;i++) { cin>>score; v.push_back(score); } sort(v.begin(),v.end()); cout<<v.at(v.size()-1)-v.at(0)<<endl; return 0; }