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 854746559 at 2011-03-20 13:32:44 on Problem 1458
In Reply To:求救 Posted by:854746559 at 2011-03-20 13:32:23
> #include<stdio.h>
> #include<string.h>
> main()
> {
>       int i,j,t,m,n,sum;
>       char a[3000],b[3000];
>       while(scanf("%s %s",a,b)!=EOF)
>       {             
>        t=0;sum=0;
>        n=strlen(a);
>        m=strlen(b);
>         for(i=0;i<n;i++)
>          for(j=t;j<m;j++)
>          {
>                          if(a[i]==b[j])
>                          {
>                            sum++;
>                            t=j;break;
>                          }
>          }
>           printf("%d\n",sum);
>         }
>       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