Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一次AC了,庆祝一下!

Posted by bjtu1 at 2008-08-15 21:39:32 on Problem 1250
相信我:
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator