03 2009 档案

摘要:// 要求算一任意长度字符串中不同的字符以及它的个数。 //c#3.0 /***************第一种方法**********************/ var values = "abcdefgabc" .GroupBy(c => c) .Select(g => String.Format("{0}, {1}", g.Key, g.Count())) .ToArray(); Array.ForEach(values, Console.WriteLine); /***************第二种方法**********************/ "abcdefgabc" .GroupBy(c => c).ToList() .ForEach(g => Console.WriteLine(g.Key + ", 阅读全文
posted @ 2009-03-28 00:01 HiEagle 阅读(1000) 评论(5) 推荐(0)
摘要:Good Programming Practice 1,Read the manuals for the version of C++ you are using. Refer to these manuals frequently to be sure you are aware of the rich collections of C++ features and that you are using them correctly. 2,Your computer and compiler are good teachers. If after reading your C++ language manuals , you still are not sure how a feature of C++ works, experiment using a small "test program" and see what happens. Set your complier options for "maximum warnings". St 阅读全文
posted @ 2009-03-02 19:34 HiEagle 阅读(1240) 评论(3) 推荐(0)