Advertisement
AquaBlitz11

TASK_050 - Poramee's Solution

Jan 7th, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int data[110];
  4.  
  5. int main(){
  6.     int n;
  7.     scanf("%d",&n);
  8.     int min = 1100,max = -1;
  9.     for(int i = 0;i < n;++i){
  10.         int input;
  11.         scanf("%d",&input);
  12.         if(input < min) min = input;
  13.         if(input > max) max = input;
  14.     }
  15.     printf("%d",max-min);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement