| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
这里面其实有两重循环的,想想你会怎么实现int strlen(const char*)?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator