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 ecust_xuchen at 2008-01-29 15:39:26 on Problem 1936
#include<iostream>
#include<stdio.h>
#define MAXSIZE 100000
using namespace std;
void cmp(char s[],char t[]){
	int i=0,j=0,sum=0;
	while(s[i]!='\0'){
		while(t[j]!='\0'){
			if(s[i]==t[j]){
				j++;
				sum++;
				break;
			}
		j++;
		}
		i++;
	}
	if(sum==i) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}
int main(){
	char s[MAXSIZE],t[MAXSIZE];
	while(scanf("%s %s",s,t)!=EOF){
	cmp(s,t);
	}
	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