Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <algorithm>
- using namespace std;
- int main () {
- int n;
- scanf("%d", &n);
- int *a = new int[n]; //same : int a[n];
- for (int i = 0; i < n; ++i)
- scanf("%d", a+i);
- printf("%d", *max_element(a, a+n)-*min_element(a, a+n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement