Witam,próbuję napisać program który liczy zestawienie liter w tekście lecz wyświetla mi on jedynie pierwszą literę z tekstu który podam
using System;
using System.Collections;
class Program
{
static void Main()
{
//char [] alfabet=new char[] {'q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'};
ArrayList litery = new ArrayList();
Console.WriteLine("Podaj tekst");
string tekst = Console.ReadLine();
for (int a = 0; a < tekst.Length; a++)
{
#region
if (a == 0)
{
litery.Add(tekst[a]);
}
#endregion
for (int i = 1; i < litery.Count; i++)
{
if (tekst[a] == Convert.ToChar(litery[i])) break;
if (tekst[a] != Convert.ToChar(litery[i]))
{
if (i == litery.Count - 1)
{
if (tekst[a] != Convert.ToChar(litery[litery.Count - 1]))
{
litery.Add(tekst[a]);
}
}
}
}
foreach (var x in litery)
{
Console.WriteLine(x);
}
}
Console.Read();
}
}
Proszę o pomoc
Pozdrawiam