1084 -- 找子串
来源:互联网 发布:嵌入式好还是java好 编辑:程序博客网 时间:2024/05/18 02:42
找子串
Time Limit:1000MS Memory Limit:65536K
Total Submit:170 Accepted:61
Description
给定原子串和目标子串,要你求得目标子串在原子串当中出现的次数。
Input
多组测试数据,每组测试数据第一行是原子串,第二行是目标子串
子串长度不会超过100.
Output
输出目标子串在原子串当中出现的次数。
Sample Input
abc123abcabcaabcCdeAbcAbcdeccdecde
Sample Output
22
Source
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AK1084 { class Program { static void Main(string[] args) { string s; while ((s = Console.ReadLine()) != null) { int count = 0; string b = Console.ReadLine(); for (int i = 0; i < s.Length - b.Length + 1; i++) { string sb = s.Substring(i, b.Length); if (sb.Equals(b)) count++; } Console.WriteLine(count); } } } }
0 0
- 1084 -- 找子串
- 1084
- 1084
- 1084
- poj1936找子串
- 1260: 找子串
- KMP--找子串
- 1260:找子串
- 找子串个数的练习
- 实现找子串的编程
- poj3461 找子串出现的个数
- problem 1084
- ZJU-1084
- hdu 1084
- 1084 四则运算
- hdu-1084
- HDU-1084
- poj 1084
- 1083 -- 分!分!分! 学生的命根
- 网站计数器
- Leetcode_016 Letter Combinations of a Phone Number
- Apache与Nginx的优缺点比较
- 25Reverse Nodes in k-Group
- 1084 -- 找子串
- 删除一个链表中的节点
- 安装go语言
- 0008.Scala主构造器、私有构造器、构造器重载实战详解
- 1085 -- 判断奇偶性
- 已知圆弧的一些信息,求得圆弧上中间点的坐标的方法(C++语言描述)
- ICPC 7096 A Rational Sequence
- Shell编程(正则表达式)学习笔记
- 计算广告学介绍