《编程之美——微软技术面试心得》一摞烧饼的排序 (不会做,看不懂) 发表于 2008-07-03 Disqus: 本文字数: 36 阅读时长 ≈ 1 分钟 《编程之美——微软技术面试心得》一摞烧饼的排序 (不会做,看不懂) 留个位置
《编程之美——微软技术面试心得》“中国象棋的将帅问题”C#实现 发表于 2008-07-02 Disqus: 本文字数: 349 阅读时长 ≈ 1 分钟 《编程之美——微软技术面试心得》“中国象棋的将帅问题”C#实现 1234567891011121314151617class Class1 { static byte counter = 81; static void Main(string[] a) { while (counter-- != 0) { if (counter / 9 % 3 == counter % 9 % 3) continue; else { System.Console.WriteLine("a=" + (counter / 9 + 1).ToString() + "b=" + (counter % 9 + 1).ToString()); } } System.Console.Read(); } }
编程之美 C#实现 1 发表于 2008-07-02 Disqus: 本文字数: 256 阅读时长 ≈ 1 分钟 适用于1.8GHZ左右的CPU 50%占用率 1234567891011121314class ManageCpu { staticvoid Main(string[] a) { int st = 0; while (true) { st = System.Environment.TickCount; while (System.Environment.TickCount - st < 90) { } System.Threading.Thread.Sleep(90); } }}