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

这里面其实有两重循环的,想想你会怎么实现int strlen(const char*)?

Posted by frkstyc at 2005-04-17 15:27:38 on Problem 1936
In Reply To:为什么啊,一重循环还判超时阿? Posted by:poochie at 2005-04-17 13:31:21
> #include <iostream.h>
> #include <string.h>
> char str[5000000],temp[5000000];
> void remain(){
> 	
> 	while(cin>>str>>temp)
> 	{
> 		unsigned long count=0;
> 		for(unsigned long i=0;i<strlen(temp);i++)
> 		{
> 			if(str[count]==temp[i]) count++;
> 			if(count==strlen(str)) break;}
> 		if(count==strlen(str)) 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