namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_53
{
    class EmailDomain
    {
        static void Main()
        {
            string email;
            bool insideDomain = false;

            System.Console.WriteLine("Wprowad adres e-mail: ");
            email = System.Console.ReadLine();

            System.Console.Write("Domena podanego adresu to: ");

            // Sprawdzenie wszystkich liter w adresie e-mail.
            foreach (char letter in email)
            {
                if(insideDomain)
                {
                    System.Console.Write(letter);
                }
                else
                {
                    if(letter == '@')
                    {
                        insideDomain = true;
                    }
                }
            }
        }
    }
}
