题解:开100的数组,进行存储人数,方便查询
题目地址:https://www.nowcoder.com/questionTerminal/3df4810cc0664b8bb848d785f68f7c9b
/** *
*作者:Ycute
*时间:2019-11-02-11.59.01
*题目题意简单描述:开100的数组,进行存储人数,方便查询
*/ #include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std; int main(){
int t;
int num[]={};
scanf("%d",&t);
while(t--){
int temp;
scanf("%d",&temp);
num[temp]++;
}
scanf("%d",&t);
while(t--){
int temp;
scanf("%d",&temp);
if(!t){
printf("%d\n",num[temp]);
}else{
printf("%d ",num[temp]);
}
}
return ;
}