while里面的输出要怎么写 才会输出 选择的 代号及对应的爱好!~
Hashtable hash = new Hashtable();
hash.Add(1, "篮球");
hash.Add(3, "足球");
hash.Add(5, "乒乓球");
hash.Add(7, "排球");
hash.Add(4, "羽毛球");
hash.Add(12, "橄榄球");
hash.Add(45,"人民币");
hash.Add(56,"星期天");
hash.Add(67, "其他");
IDictionaryEnumerator ie = hash.GetEnumerator();
while(ie.MoveNext())
{
string s = string.Format ("代号{0},爱好{1}",ie.Key,ie.Value);
Console.WriteLine(s);
}
while (true)
{
Console.WriteLine("\n请选择你的爱好:");
string xx = Console.ReadLine();
Convert.ToInt32(xx);
Console.WriteLine("代号{0},爱好{1}", hash[xx],????);
}
Console.Read();