《编程之美——微软技术面试心得》“中国象棋的将帅问题”C#实现

来源:互联网 发布:哈尔滨程序员工资待遇 编辑:程序博客网 时间:2024/04/27 23:06

《编程之美——微软技术面试心得》“中国象棋的将帅问题”C#实现  

class 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();        

}     

}

原创粉丝点击