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

纯java思想c++选手飘过 string iterator

Posted by jwdlh918 at 2010-12-07 22:09:51 on Problem 1936
#include <iostream>
#include <string>
using namespace std;
string s;
string t;
string::iterator sIter,tIter;
void sub(){
	int sLength=s.length();
	int tLength = t.length();
	for(sIter = s.begin(),tIter = t.begin();sIter!=s.end()&&tIter!=t.end();){
		if(*sIter == *tIter){
			sIter++;
			tIter++;
		}
		else{
			tIter++;
		}
	}
	if(sIter==s.end()){
		cout<<"Yes"<<endl;
	}
	else
		cout<<"No"<<endl;
}
int main(){
	while(cin>>s>>t){
		sub();
	}
	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