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 ccrrzz2002 at 2012-08-27 19:52:53 on Problem 1318
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int nvocab=0,len,i,j,k;
	string temp,vocab[300];
	string word,str1;
	bool found;
	while(1)
	{
		cin>>temp;
		if(temp=="XXXXXX")break;
		vocab[nvocab++]=temp;
	}
	while(1)
	{
		cin >>word;
		if(word=="XXXXXX")break;
		len=word.length();
		cout<<endl;found=false;
		for(i=0;i<nvocab;i++)
		{
			if(vocab[i].length()==len)
			{
				temp=vocab[i];
				for(j=0;j<len;j++)
				{					
					for(k=0;k<len;k++)
					{
						if(temp[k]==word[j])temp[k]='1';
					}				
				}
				if(temp==str1.assign("111111",0,len))
				{
					cout<<vocab[i]<<endl;
					found=true;
				}
			}
		}
		if(!found)cout<< "NOT A VALID WORD"<<endl;
		cout<<"******"<<endl;
	}
}


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