#include <iostream>
using namespace std;
int main() {
cout << "N: ";
int N; cin >> N;
int a[N+1];
int max = 0;
int counter = 0;
for(int i = 1; i<=N; ++i) {
cin >> a[i];
if(a[i]>max) {
max = a[i];
}
if(a[i]==max) {
++counter;
cout << "Max element: " << max << " met " << counter << " times";
#include <iostream>
using namespace std;
int main() {
cout << "N: ";
int N; cin >> N;
int a[N+1];
int max = 0;
int counter = 0;
for(int i = 1; i<=N; ++i) {
cin >> a[i];
if(a[i]>max) {
max = a[i];
}
}
for(int i = 1; i<=N; ++i) {
if(a[i]==max) {
++counter;
}
}
cout << "Max element: " << max << " met " << counter << " times";
}