Advertisement
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.RegularExpressions;
- using System.Threading.Tasks;
- namespace Palindromes_6
- {
- class Palindromes_6
- {
- static void Main(string[] args)
- {
- string words = Console.ReadLine();
- var result = Regex.Matches(words, @"\w+").Cast<Match>()
- .Select(m => m.Value)
- .Where(w => String.Join("", w.Reverse()) == w).ToList();
- Console.WriteLine(string.Join(" ", result));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement