Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MiniLab
- {
- class Program
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine().ToLower();
- string repeats = Console.ReadLine().ToLower();
- int cnt = 0;
- int index = text.IndexOf(repeats);
- while (index != -1)
- {
- cnt++;
- index = text.IndexOf(repeats, index +1);
- }
- Console.WriteLine(cnt);
- // string reverse = new string(text.ToCharArray().Reverse().ToArray());
- // Console.WriteLine(reverse);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement