P1097 统计数字

https://www.luogu.org/problemnew/show/P1097

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <bits/stdc++.h>
using namespace std;

map<int,int> num;
set<int> qwq;
int n,in;

int main(void)
{
cin >> n;

for(int i = 1;i <= n;++i)
{
cin >> in;
num[in]++;
qwq.insert(in);
}

for(set<int>::iterator it = qwq.begin();it != qwq.end();++it)
cout << *it << " " << num[*it] << endl;

return 0;
}
本站文章除注明转载外均为原创,未经允许不要转载哇. ヾ(゚ー゚ヾ) http://chicago01.top/2019/05/14/p1097-tong-ji-shu-zi/index.html
Compartir