0
If I have six names and a number related to each name(six inputs) how can I get as an output the name who has the greatest nr?
nested loops
2 Antworten
0
Assuming a dictionary of names as keys and numbers as values:
Dictionary<string, int> dictionary =
new Dictionary<string, int>();
....add all the values to dictionary
string maxName = dictionary.MaxBy(kvp => kvp.Value).Key;
0
thank you