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;
- using System.Text.RegularExpressions;
- namespace ConsoleApplication6
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int counter = 0;
- int occurences = 0;
- List<int> numbers = new List<int>();
- string pattern = @"(hackerrank)";
- Regex regex = new Regex(pattern);
- List<string> output = new List<string>();
- do
- {
- string input = Console.ReadLine();
- input = input.ToLower();
- if (regex.IsMatch(input) == true)
- {
- occurences++;
- }
- counter++;
- } while (counter < n);
- Console.WriteLine(occurences);
- }
- }
- }
Add Comment
Please, Sign In to add comment