#include<stdio.h> int main() { int n = 0; int x = 0; scanf("%d",&n); int max = 0; int min = 100; while(n--) { scanf("%d ",&x); if(max < x) max = x; if(min > x) min = x; } printf("%d\n",max-min); return 0; }
#include<stdio.h> int main() { int n = 0; int x = 0; scanf("%d",&n); int max = 0; int min = 100; while(n--) { scanf("%d ",&x); if(max < x) max = x; if(min > x) min = x; } printf("%d\n",max-min); return 0; }