Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- namespace SnowFlake
- {
- class Program
- {
- static void Main(string[] args)
- {
- string surfaceRegex = @"[^a-zA-Z\d]+";
- string mantleRegex = @"[\d_]+";
- string coreRegex = @"[A-Za-z]+";
- string full = @"[^a-zA-Z\d]+[\d_]+([A-Za-z]+)[\d_]+[^a-zA-Z\d]+";
- string topSurface = Console.ReadLine();
- string topMantle = Console.ReadLine();
- string wtf = Console.ReadLine();
- string bottomMantle = Console.ReadLine();
- string bottomSurface = Console.ReadLine();
- var firstMatch = Regex.Match(topSurface, surfaceRegex);
- var secondMatch = Regex.Match(topMantle, mantleRegex);
- var wtfMatch = Regex.Match(wtf, full);
- var fourthMatch = Regex.Match(bottomMantle, mantleRegex);
- var fifthMatch = Regex.Match(bottomSurface, surfaceRegex);
- if (firstMatch.Success && secondMatch.Success && wtfMatch.Success && fourthMatch.Success && fifthMatch.Success)
- {
- Console.WriteLine("Valid");
- Console.WriteLine(wtfMatch.Groups[1].Value.Length);
- }
- else
- {
- Console.WriteLine("Invalid");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement