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

水题贴代码。。 请大牛们指教。。。

Posted by 315009476 at 2011-10-06 19:47:44 on Problem 2403
#include <iostream>
#include <string>
using namespace std;
struct word
{
	int date;
	string a;
}w[10000];

int main ()
{
	int m,n,i;
	cin>>m>>n;
	for (i=0;i<m;i++)
		cin>>w[i].a >>w[i].date;
	while (n--)
	{
		string ch,c;
		int sum=0;
		c=".";
		
		while (cin>>ch && ch!=c)
		{
			for (i=0;i<m;i++)
				if (ch==w[i].a ) sum += w[i].date;

		}
		cout<<sum<<endl;

	}
	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