标签:
Dictionary<string, int> counter = new Dictionary<string, int>(); foreach (string c in 数组) { if (counter.ContainsKey(c)) { counter[c]++; } else { counter.Add(c, 1); } if (counter[max] < counter[c]) max = c; } max为元素 counter[max]出现次数最多的元素出现的次数
标签:
原文地址:http://www.cnblogs.com/shenwuyu/p/5163787.html