0
点赞
收藏
分享

微信扫一扫

pta1038 统计同成绩学生 c++

颜娘娘的碎碎念 2022-02-23 阅读 51
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,score,k;
	cin>>n;
	map<int,int>b;
	for(int i=0;i<n;i++){
		cin>>score;
		b[score]++;
	}
	cin>>k;
	for(int i=0;i<k;i++){
		cin>>score;
		if(i!=k-1)cout<<b[score]<<" ";
		else cout<<b[score];
	}
	return 0;
}

水题

举报

相关推荐

0 条评论