| ||||||||||
| 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 | |||||||||
Re:求救,哪里错了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator