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

WA了,不知道哪里不对啊,帮忙看下

Posted by 3080434005 at 2009-01-21 11:09:58 on Problem 1318
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<functional>
using namespace std;
int main()
{
	vector<string> v1,v2;
	char        str[100];
	bool        wow,yeah;
	while(gets(str))
	{
		if(str[0]=='X')
			break;
		v1.push_back(str);
	}
	while(gets(str)&&str[0]!='X')
	{
		v2.push_back(str);
	}
	for(int i=0;i<v2.size();i++)
	{ 
		wow=false;
		yeah=true;
		sort(v2[i].begin(),v2[i].end());
        while(yeah)
		{
		  for(int k=0;k<v1.size();k++)
			  if(equal(v2[i].begin(),v2[i].end(),v1[k].begin()))
			  {
				  wow=true;
				  cout<<v1[k]<<endl;
			  }
          yeah=next_permutation(v2[i].begin(),v2[i].end());
		} 
		if(wow)
			printf("******\n");
		else
			printf("NOT A VALID WORD\n******\n");
	}
	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