标题最大值最小值之差

int main()
{
    int n = 0;
    int m = 0;
    int max = 0;
    int min = 100;
    scanf("%d",&n);

    for(int i = 0;i<n;i++)
    {
        scanf("%d", &m);
        if(m>max)
        {
            max = m;
        }
        if(m<min)
        {
            min = m;
        }

    }

    printf("%d",max-min);
    return 0;
}