include <bits/stdc++.h>
using namespace std;
int main() { long long n,t; int N = 1e6; long long a[N+1]; t=0; cin>>n; for(int i =1;i<=n; i++) cin>>a[i]; for(int i=1; i<=12; i++) { t=0; for(int j=1; j<=n; j++){ if(a[j] == i) t++; } if(t>0) cout<<i<<" "<<t<<endl; } return 0; }</p>
Bình luận