IanosStefanCristian

H4ck3r Sp34k

Mar 9th, 2021
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. /*In order to work properly, the function should replace all "a"s with 4, "e"s with 3, "i"s with 1, "o"s with 0, and "s"s with 5. */
  7. namespace EdabitChallenges
  8. {
  9. class Program
  10. {
  11.  
  12. static void Main(string[] args)
  13. {
  14.  
  15. var replacements = new Dictionary<string, string>()
  16. {
  17. { "a", "4" },
  18. { "e", "3" },
  19. { "i", "1" },
  20. { "o", "0" },
  21. { "s", "5" }
  22. };
  23. string str = Console.ReadLine();
  24. foreach (var replace in replacements)
  25. {
  26. str = str.Replace(replace.Key, replace.Value);
  27. }
  28.  
  29. Console.WriteLine(str);
  30. Console.ReadLine();
  31.  
  32. }
  33. }
  34.  
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment