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

好郁闷啊!高手帮忙!SOS!

Posted by 00400000 at 2005-06-03 20:09:05 on Problem 2159
#include<iostream>
#include<string>
using namespace std;
void main()
{
	string s1,s2;
	int i,j;
	cin>>s1;
	cin>>s2;
	for(i=0;i<s2.length();i++)
	{
		if(s2[i]=='Z')
			s2[i]='A';
		else
			s2[i]=s2[i]+1;
	}
	for(i=0;i<s1.size();i++)
	{
		j=s1.find(s2[i]);
		while(j<string::npos)
		{
			if(s2[j]==s1[i])
				break;
			j=s1.find(s2[i],j+1);
		}
		if(j==string::npos)
			break;
	}
	if(j==string::npos)
		cout<<"NO\n";
	else
		cout<<"YES\n";
}


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