#include<stdio.h> int main(){ int max=0; int min=100; int n=0; int score[100]={0}; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&score[i]); if(score[i]>max){ max=score[i]; } if(score[i]<min){ min=score[i]; } } printf("%d",max-min); return 0; }
#include<stdio.h> int main(){ int max=0; int min=100; int n=0; int score[100]={0}; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&score[i]); if(score[i]>max){ max=score[i]; } if(score[i]<min){ min=score[i]; } } printf("%d",max-min); return 0; }