#include #include using namespace std;

int main() { int n; cin >> n;

map<int, int> countMap;
for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    countMap[num]++;
}

for (auto it = countMap.begin(); it != countMap.end(); it++) {
    cout << it->first << ' ' << it->second << endl;
}

return 0;

}


原文地址: https://www.cveoy.top/t/topic/qnlb 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录