Advertisement
Guest User

Double Palindromes

a guest
May 18th, 2016
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. namespace ConsoleApplication2
  2. {
  3.     using System;
  4.     using System.Collections.Generic;
  5.     using System.Text.RegularExpressions;
  6.  
  7.     public class Program
  8.     {
  9.         public static void Main()
  10.         {
  11.             List<string> list = new List<string>();
  12.             for (int i = 0; i < 129; i++)
  13.             {
  14.                 string input = Console.ReadLine();
  15.                 Regex regex = new Regex(@"\s?(\d+)\s+(\d+)\s(\d+)\s+(\d+)");
  16.                 Match match = regex.Match(input);
  17.  
  18.                 if (match.Success)
  19.                 {
  20.                     list.Add(match.Groups[4].ToString());
  21.                 }
  22.             }
  23.  
  24.             foreach (var palindrome in list)
  25.             {
  26.                 Console.WriteLine(palindrome);
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement