Kész van minden!

This commit is contained in:
krajcsozsombor 2023-09-21 10:16:31 +02:00
parent 1cdd24348b
commit e174771712

View File

@ -24,6 +24,27 @@ namespace kosar2004
public void Feladat7()
{
Console.WriteLine("7.Feladat:");
Dictionary<string, int> stadionok = new Dictionary<string, int>();
foreach (var item in kosar)
{
if (stadionok.ContainsKey(item.helyszin))
{
stadionok[item.helyszin]++;
}
else
{
stadionok.Add(item.helyszin, 1);
}
}
foreach (KeyValuePair<string, int> st in stadionok)
{
if (st.Value > 20)
{
Console.WriteLine($"\t{st.Key}: {st.Value}");
}
}
}