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 chenweifeng at 2006-04-09 16:05:49 on Problem 1936
#include<iostream>
#include<string>
using namespace std;
int main()
{
 string s1,s2;
 while(cin>>s1>>s2)
 {
  int k=0,j=0;
  int len1 =s1.length();
  int len2 = s2.length();
  for(int i =0;i<len1;i++)
   for(;j<len2;j++)
    if(s1[i]==s2[j])
    {
		k++;
		if(k==len1)   
		{
		 cout<<"Yes"<<endl;goto End;
         }
		break;
	}
    else
		if(j==len2-1)
		{
			cout<<"No"<<endl; goto End;
		 }  
	else
      continue;
End:
	continue;
   }
 
  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