展开全部
#include
#include
void main()
{
char str1[20], str2[20], *p1, *p2;
int sum=0;
printf("Please enter two strings\n");
scanf("%s%s", str1, str2);
p1=str1;
p2=str2;
while(*p1 != '\0')
{
if(*p1 == *p2)
{
while(*p1 == *p2 && *p2 != '\0')
{
p1++;
p2++;
}
}
else
p1++;
if(*p2 == '\0')
sum++;
p2=str2;
}
printf("%d", sum);
getchar();
}
希望这个能帮到你。。加油62616964757a686964616fe78988e69d8331333332643262吧少年请放心使用,有问题的话请追问
满意请及时采纳,谢谢,采纳后你将获得5财富值。
你的采纳将是我继续努力帮助他人的最强动力!