#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,max=0,min=1000,x;
  cin>>n;
  for(int i=1;i<=n;i++)
  {
    cin>>x;
    if(x>max)
    max=x;
    if(x<min)
    min=x;
  }
  cout <<max-min<<endl;
    return 0;
}

0 comments

No comments so far...

Information

ID
788
Time
1000ms
Memory
256MiB
Difficulty
5
Tags
# Submissions
44
Accepted
18
Uploaded By