Advertisement
ralichka

Untitled

Nov 29th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace _04.StarEnigma
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11. for (int i = 0; i < n; i++)
  12. {
  13. string newPassword = "";
  14. string input = Console.ReadLine();
  15. int key = 0;
  16. Regex star = new Regex(@"[s,t,a,r,S,T,A,R]");
  17. MatchCollection matchStar = star.Matches(input);
  18. for (int a = 0; a < matchStar.Count; a++)
  19. {
  20. key += a;
  21. }
  22.  
  23. for (int j = 0; j < input.Length; j++)
  24. {
  25. int currentSymbol = input[j];
  26. currentSymbol -= key;
  27. newPassword += (char)currentSymbol;
  28. }
  29.  
  30. Regex planetRegex = new Regex(@"@[A-Za-z]+");
  31. Regex populationRegex = new Regex(@":\d+");
  32. Regex typeRegex = new Regex(@":\d+");
  33. }
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement