Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Numerics;
- using System.Text;
- using System.Text.RegularExpressions;
- namespace Exr
- {
- public class Program
- {
- static void Main(string[] args)
- {
- var input = Console.ReadLine();
- MatchCollection digitMatch = Regex.Matches(input, @"\d");
- int coolness = 1;
- foreach (var digit in digitMatch.Select(x => x.Value))
- {
- coolness *= int.Parse(digit);
- }
- Console.WriteLine($"Cool threshold: {coolness}");
- MatchCollection matches = Regex.Matches(input, @"(::|\*\*)(?<word>[A-Z][a-z]{2,})\1");
- if(matches.Count == 0)
- {
- return;
- }
- Console.WriteLine($"{matches.Count} emojis found in the text. The cool ones are:");
- foreach (Match match in matches)
- {
- int currentCoolness = match.Groups["word"].Value.Sum(c => c);
- if(currentCoolness >= coolness)
- {
- Console.WriteLine(match.Value);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement