#include <bits/stdc++.h> #include<math.h> #include <string> using namespace std; const int MAX_LEN = 100005; int main(){ int n; int temp[101]; for(int i=0;i<101;++i){ temp[i] = 0; } scanf("%d",&n); int cease[n]; for(int i=0;i<n;++i){ cin>>cease[i]; temp[cease[i]]++; } int tem; cin>>tem; int te[tem]; for(int i =0;i<tem;++i){ cin>>te[i]; } for(int i=0;i<tem;++i){ int result = te[i]; if(i ==0){ cout<<temp[result]; }else{ cout<<" "<<temp[result]; } } system("pause"); return 0; }
原文地址:https://www.cnblogs.com/JasonPeng1/p/12155910.html
时间: 2024-09-29 20:12:06