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;
- using System.Threading.Tasks;
- /*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. */
- namespace EdabitChallenges
- {
- class Program
- {
- static void Main(string[] args)
- {
- var replacements = new Dictionary<string, string>()
- {
- { "a", "4" },
- { "e", "3" },
- { "i", "1" },
- { "o", "0" },
- { "s", "5" }
- };
- string str = Console.ReadLine();
- foreach (var replace in replacements)
- {
- str = str.Replace(replace.Key, replace.Value);
- }
- Console.WriteLine(str);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment