#include <iostream>
int main() {
int arr[]{5,2,1,3,1,4,2,1,6,2,6};
int res{0}, max{0};
for(int i : arr) {
int count{0};
for(int j : arr) {
if(i == j) ++count;
}
if(max < count) { res = i; max = count; }
}
std::cout << "Most encountered number in this array is number - "
<< res << ", which encountered " << max << " times";
return 0;
}