문제가 60명의 점수를 50~99인 난수로 입력받고 60개의 수들 중에서 최대값과 최소값의 개수를 구해야 하는데.. 개수를 못구하겠어요..

코드는 아래에 적어놨어요 ㅠㅠㅠㅠ 부탁드립니다


#include <stdio.h>

#include <stdlib.h>


int main(void) {

int i, cnt1 = 0, cnt2 = 0, min = 99, max = 50, a[60];

for (i = 0; i < 60; i++) {

a[i] = rand() P + 50;

if (a[i] > max) {

max = a[i];

cnt1++;

}

if (min > a[i]) {

min = a[i];

cnt2++;

}

}

printf("최대값의개수는%d개,최솟값의개수는 %d개\n", cnt1, cnt2);

return(0);

}