Kész van minden!
This commit is contained in:
parent
1cdd24348b
commit
e174771712
|
@ -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}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user