using System;
public class Test
{
const string eng = "qwertyuiop[]asdfghjkl;'zxcvbnm,.QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>";
const string ru = "йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ";
public static void Main()
{
string input = "Vhodnaya строка ЭЮ йцуке qwert";
Console.WriteLine($"Before: {input}");
Console.WriteLine($"After: {SwapInputMethod(input)}");
}
public static string SwapInputMethod(string inputString)
{
char[] input = inputString.ToCharArray();
for (int i = 0; i < input.Length; i++)
{
if (eng.Contains(input[i].ToString()))
{
input[i] = ru[eng.IndexOf(input[i])];
continue;
}
if (ru.Contains(input[i].ToString()))
{
input[i] = eng[ru.IndexOf(input[i])];
continue;
}
}
return new string(input);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJY29uc3Qgc3RyaW5nIGVuZyA9ICJxd2VydHl1aW9wW11hc2RmZ2hqa2w7J3p4Y3Zibm0sLlFXRVJUWVVJT1B7fUFTREZHSEpLTDpcIlpYQ1ZCTk08PiI7Cgljb25zdCBzdHJpbmcgcnUgPSAi0LnRhtGD0LrQtdC90LPRiNGJ0LfRhdGK0YTRi9Cy0LDQv9GA0L7Qu9C00LbRjdGP0YfRgdC80LjRgtGM0LHRjtCZ0KbQo9Ca0JXQndCT0KjQqdCX0KXQqtCk0KvQktCQ0J/QoNCe0JvQlNCW0K3Qr9Cn0KHQnNCY0KLQrNCR0K4iOwoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCXN0cmluZyBpbnB1dCA9ICJWaG9kbmF5YSDRgdGC0YDQvtC60LAg0K3QriDQudGG0YPQutC1IHF3ZXJ0IjsKCQlDb25zb2xlLldyaXRlTGluZSgkIkJlZm9yZToge2lucHV0fSIpOwoJCUNvbnNvbGUuV3JpdGVMaW5lKCQiQWZ0ZXI6IHtTd2FwSW5wdXRNZXRob2QoaW5wdXQpfSIpOwoJf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