1 solutions

  • 1
    @ 2024-10-3 20:28:22

    #include <stdio.h>

    int main() { int n, min, num,max; scanf("%d", &n); min = 1001,max = 0; for (int i = 0; i < n; i++) { scanf("%d", &num); if (num < min) { min = num; } if (num > max) { max =num; } } printf("%d",max-min); return 0; }

    • 1

    Information

    ID
    6764
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    4
    Tags
    # Submissions
    181
    Accepted
    84
    Uploaded By