Rohyoohyun / C

0 stars 0 forks source link

1546 평균 #40

Open Rohyoohyun opened 3 months ago

Rohyoohyun commented 3 months ago
#include <stdio.h>
int main(){
    int n, sum=0, max=0;
    scanf("%d", &n);

    int arr[n];
    for (int i = 0; i < n; i++){
        scanf("%d", &arr[i]);
        sum += arr[i];
        if (max < arr[i])  max = arr[i];
    }
    printf("%lf", ((double)sum/max * 100)/n);
    return 0;
}