| ||||||||||
| 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 | |||||||||
求救#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