Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
一次AC了,庆祝一下!相信我: #include<iostream> #include<string> #include<map> using namespace std; int main() { char str[100]; string in; map<string,int>level; int n,i,m; while(scanf("%d",&n)!=EOF){ level.clear(); for(i=1;i<=n;i++){ scanf("%s",str); in=str; level[in]++; } scanf("%d",&m); for(i=1;i<=m;i++){ scanf("%s",str); in=str; printf("%d\n",level[in]); } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator