摘要: 题目链接题目大意:给你两个字符串,让你求第二个字符串在第一个字符串中出现了几次,注意不能有重叠的区间。由于这题的数据不大,所以朴素的字符串匹配就能解决问题。代码如下: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 5 char str[1005],substr[1005]; 6 int len1,len2,cnt; 7 char *p,*q; 8 9 int main()10 {11 do12 {13 cnt=0;14 scanf("%s",str.. 阅读全文
posted @ 2012-09-22 00:36 Amazing_Y 阅读(473) 评论(0) 推荐(0) 编辑