HDU
来源:互联网 发布:ios多线程编程 面试 编辑:程序博客网 时间:2024/06/06 01:39
#include<stdio.h>#include<string.h>int main(){ char hua[1001];char shi[1001];int hua_len;int shi_len;int i;int j;bool matched;int count;while(scanf("%s",hua)!=EOF){if(hua[0]=='#'){ break;}scanf("%s",shi);matched=true;count =0; hua_len=strlen(hua);shi_len=strlen(shi); for(i=0;i<hua_len;i++){matched=true;if(hua_len-i-shi_len<0){ break;} for(j=0;j<shi_len;j++){ if(hua[i+j]!=shi[j]){ matched=false;break;}}if(matched){ count++;i+=shi_len-1;}}printf("%d\n",count);}return 0;}
阅读全文
0 0
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- hdu
- hdu
- HDU
- 牛客网(第三场)编程题
- HDU
- 将一组数分为相等的两组数
- xcode pod文件不提示 $(PODS_ROOT)"
- Codeforces 810C Do you want a date? 题解
- HDU
- Coin Toss(UVA
- VS2010 语法错误: 标识符“__RPC__out_xcount_part” 解决方法
- Math类
- AVL树详解
- CodeForces
- HDU
- shell中单引号、双引号、反引号的区别
- JS部分高阶函数的运用及解析