标签:style ar io color os sp for on div
Binary String Matching
3 11 1001110110 101 110010010010001 1010 110100010101011
3 0 3
#include<stdio.h> #include<string.h> int main(void) { int n; char a[100],b[1000]; int i,j,k; int count; scanf("%d",&n); getchar(); while(n--) { count=0; scanf("%s%s",a,b); for(i=0;i<strlen(b);i++) { if(b[i]==a[0]) { for(j=1;j<strlen(a);j++) { if(b[i+j]!=a[j]) { break; } } if(j==strlen(a)) count++; } } printf("%d\n",count); } return 0; }
标签:style ar io color os sp for on div
原文地址:http://blog.csdn.net/qq_16997551/article/details/41981429