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

Re:~~~错在哪了???

Posted by gao at 2006-03-29 18:01:14
In Reply To:~~~错在哪了??? Posted by:gao at 2006-03-29 17:54:04
> #include "stdio.h"
> 
> int solve(char *s1,char *s2)
> {
>      int i1,i2,n;
>      for(i1=0,i2=0;s1[i1]!='\0';i1++,i2++){
> 	  while(s1[i1]!=s2[i2]){
> 	       if(s2[i2]=='\0')  return 0;
> 	       i2++;
> 	  }
>      }
>      return 1;
> }
> 
> main()
> {
>      int i1,i2,t,sum[10000];
>      char  s1[10000],s2[10000];
>      for(i1=0;
>      scanf("%s %s",s1,s2)!=EOF;
>      i1++)
> 	  sum[i1]=solve(s1,s2);
>      for(i2=0;i2<i1;i2++){
> 	  if(sum[i1]==0)
> 	       printf("No\n");
> 	  else
> 	       printf("Yes\n");
>      }
> }

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