#include <stdio.h>
#include <stdlib.h>
#define N 1000
int main()
{
char a[N],b[N];
int i=0,j,count=0,p=0,start;
while((a[i]=getchar())!='\n')
i++;
i=0;
while((b[i]=getchar())!='\n')
i++;
for(j=0;j<i;j++)
{
if(a[j]!=b[j])
{
if(p==0)
{
start=j;
p=1;
}
else
{
count=count+(j-start);
p=0;
}
}
}
printf("%d",count);
return 0;
}
三个数据都超时了,是不是这个算法有问题