mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
33 lines
654 B
C++
33 lines
654 B
C++
|
#include<stdio.h>
|
||
|
#include<string.h>
|
||
|
int main()
|
||
|
{
|
||
|
char a[1000001],b[100001];
|
||
|
int s,i,j,p,count,len1,len2;
|
||
|
scanf("%d",&s);
|
||
|
while(s--)
|
||
|
{
|
||
|
count=0;
|
||
|
scanf("%s %s",a,b);
|
||
|
len1=strlen(a);
|
||
|
len2=strlen(b);
|
||
|
for(i=0;i<=len1-1;i++)
|
||
|
{
|
||
|
p=i;
|
||
|
for(j=0;j<=len2-1;j++)
|
||
|
{
|
||
|
if(a[p]==b[j]) {p++;}
|
||
|
else
|
||
|
break;
|
||
|
}
|
||
|
if(j==len2)
|
||
|
{
|
||
|
count++;
|
||
|
i=i+len2-1;
|
||
|
}
|
||
|
}
|
||
|
printf("%d\n",count);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|