using System;
using System.Linq;
using System.Collections.Specialized;
class Program
{
static void Main() {
NameValueCollection nvc = new NameValueCollection();
nvc.Add("c#", "2");
nvc.Add("c", "1");
nvc.Add("php", "5");
nvc.Add("java", "4");
nvc.Add("python", "3");
var items = nvc.AllKeys.SelectMany(nvc.GetValues, (k, v) => new {key = k, value = v});
foreach (var item in items)
Console.WriteLine(item.key + " - " + item.value);
}
}
/*
run:
c# - 2
c - 1
php - 5
java - 4
python - 3
*/