Krum_50

Destination Mapper

Jan 16th, 2021
753
324 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace Destinatoins_Mapper
  5. {
  6.     class Program
  7.     {
  8.         private static object math;
  9.  
  10.         static void Main(string[] args)
  11.         {
  12.             string text = Console.ReadLine();
  13.             string pattern = @"[=|\|][A-Z][a-z][=|\|]";
  14.             int travelPoints = 0;
  15.             Match match = Regex.Match(text, pattern);
  16.             while (match.Success)
  17.             {
  18.                 travelPoints += match.Length;                
  19.                 Console.Write($"{math}, ");              
  20.                 match = match.NextMatch();
  21.             }
  22.             Console.WriteLine($"TravelPoints: {travelPoints}");
  23.  
  24.         }
  25.     }
  26. }
  27.  
RAW Paste Data