代码实现:
#include<stdio.h>
int main()
{
int N, score[101], K;
scanf("%d", &N);
for (int i = 0; i < 101; i++)score[i] = 0;
for (int i = 0; i < N; i++)
{
int score1;
scanf("%d", &score1);
score[score1]++;
}
scanf("%d", &K);
for (int i = 0; i < K; i++)
{
int target;
scanf("%d", &target);
printf("%d", score[target]);
if (i != K - 1)printf(" ");
}
return 0;
}