Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
377 B
0
Indexable
Never
#include <iostream>
#include <math.h>
#include <string>

int main() {
    
    int N,max = -9999999,count = 0;


    std::cin >> N;
    int a;
    for (int i = 0; i < N; i++) {
        std::cin >> a;
        if (a > max) {
            max = a;
            count = 1;
        }else if (a == max) {
            count += 1;
        }
    }std::cout << count;
}
Leave a Comment