Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Numerics;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class SoftUni
  8. {
  9. static void Main()
  10. {
  11. string html = Console.ReadLine();
  12.  
  13. string pPattern = @"(?<=<p>)(.*?)(?=<\/p>)";
  14.  
  15. string replacementPattern = @"([\W])";
  16.  
  17. html = string.Join("", from Match match in Regex.Matches(html, pPattern) select match.Value);
  18.  
  19. html = Regex.Replace(html, replacementPattern, " ");
  20. html = Regex.Replace(html, " +( |$)", "$1");
  21.  
  22. string output = "";
  23.  
  24. foreach (char c in html.ToLower())
  25. {
  26. if (c>=97 && c<= 109)
  27. {
  28. output += (char)(c+13);
  29. }
  30. else if (c >= 110 && c <= 122)
  31. {
  32. output += (char)(c - 13);
  33. }
  34. else
  35. {
  36. output += (char)c;
  37. }
  38. }
  39.  
  40. Console.WriteLine(output);
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement