Advertisement
AquaBlitz11

TASK_050 - ChimengSoso's Solution

Jan 7th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main () {
  6.     int n;
  7.     scanf("%d", &n);
  8.  
  9.     int *a = new int[n]; //same : int a[n];
  10.     for (int i = 0; i < n; ++i)
  11.         scanf("%d", a+i);
  12.  
  13.     printf("%d", *max_element(a, a+n)-*min_element(a, a+n));
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement