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

贴代码了0ms秒过

Posted by louchiheng at 2016-03-29 12:51:57 on Problem 1936
#include<iostream>
#include<string.h>
#include<cstdio>
using namespace std;
int i,j,l1,l2;
bool flag;
char c1[100001],c2[100001];
int main()
{
    while(~scanf("%s%s",c1,c2))
    {	
    	l1=strlen(c1);
    	l2=strlen(c2);
    	if(l1>l2)
    	{
    		cout<<"No"<<endl;
    		continue;
    	}
    	for(i=0;i<l1;i++)
    	if(c1[i]>='A'&&c1[i]<='Z')c1[i]-='A'-'a';
    	for(i=0;i<=l2;++i)
    	if(c2[i]>='A'&&c2[i]<='Z')c2[i]-='A'-'a';
    	i=0;
    	for(j=0;j<l2;++j)if(c1[i]==c2[j])i++;
    	if(i==l1)cout<<"Yes"<<endl;else cout<<"No"<<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