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 kirsten0302 at 2009-08-03 17:49:24 on Problem 1936
Yes...和No...
贡献了一次wa,本来可以一次ac的~

献上代码,很简单得比较阿。
#include <iostream>
#include <string.h>
using namespace std;
char a[100000],b[100000];
int main()
{
	
	int m,n,i,j;
	while (scanf("%s%s",a,b)!=EOF)
	{
		j=0;
		m=strlen(a);
		n=strlen(b);
		for (i=0;i<n;i++)
		{
			if (b[i]==a[j])
			{
				j++;
			}
		}
		if (j==m) cout<<"Yes"<<endl;
		else cout<<"No"<<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