using System.Runtime.InteropServices;
using System.Collections.Generic;
public static void Main()
string zdanie_1, zdanie_2;
Console.WriteLine("Podaj pierwszą próbkę");
zdanie_1 = Console.ReadLine();
Console.WriteLine("Podaj drugą próbkę");
zdanie_2 = Console.ReadLine();
Console.WriteLine(Annagramator(zdanie_1, zdanie_2));
static Boolean Annagramator(string ciag1, string ciag2)
List<char> lista = new List<char>();
TylkoLitery(ciag1, ref tylkoznaki1);
TylkoLitery(ciag2, ref tylkoznaki2);
lista.AddRange(tylkoznaki2);
if (tylkoznaki1.Length == tylkoznaki2.Length)
foreach (char litera1 in tylkoznaki1)
foreach (char litera2 in lista)
static void TylkoLitery(string zespacja, ref string nowyciag)
for (int i = 0; i < zespacja.Length; i++)
if (Char.IsLetter(zespacja[i]))
nowyciag=nowyciag.ToLower();