-
-
Save unilecs/724932323d78b5c03b0074d59f67ddf1 to your computer and use it in GitHub Desktop.
Задача 134: Пропущенный символ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static char GetRemovedSymbol(char[] first, char[] second) | |
{ | |
char removedSymbol = '\0'; | |
for (int i = 0; i < first.Length; i++) | |
{ | |
removedSymbol ^= first[i]; | |
} | |
for (int i = 0; i < second.Length; i++) | |
{ | |
removedSymbol ^= second[i]; | |
} | |
return removedSymbol; | |
} | |
public static void Main() | |
{ | |
Console.WriteLine("UniLecs"); | |
char[] first = new char[] { 'a', 'b', 'c' }; | |
char[] second = new char[] { 'a', 'b' }; | |
Console.WriteLine(string.Format("Answer = {0}", GetRemovedSymbol(first, second))); // 'c' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment