Răspuns:
#include <iostream>
using namespace std;
int v[100], frecv[101], n, i;
int main ()
{
cin >> n;
for (i = 1; i <= n; i ++) {
cin >> v[i];
frecv[v[i]] ++;
}
for (i = 1; i <= 100; i ++)
if (frecv[i] != 0) cout << i << " " << frecv[i] << endl;
return 0;
}