#include<stdio.h>
#include<string.h>
int main()
{
    char a[51],b[51];
    int i,n,t=1;
    scanf("%s %s",a,b);
    n=strlen(b);
    for(i=0;i<n;i++)
    {
        if(a[t-1]==b[i])t++;    
    }
    printf("%d",t);
    return 0;
}

http://codeforces.com/contest/265/problem/A

posted on 2013-01-21 00:23  海暗  阅读(186)  评论(0编辑  收藏  举报