算法:12?56? * 123 =154?4987 求问号的值

来源:互联网 发布:手机网页广告过滤 知乎 编辑:程序博客网 时间:2024/05/22 04:33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            XiangCheng();
        }
        //12?56?  * 123 =154?4987
        public static void XiangCheng()
        {
            for (int i = 0; i <= 9; i++)
{
                for (int j = 0; j <= 9; j++)
  {
                    for (int h = 0; h <= 9; h++)
        {
            if (Convert.ToInt32(12*10000+i*1000+56*10+j)*123==154*100000+h*10000+4987)
                     {
                              Console.WriteLine(i.ToString()+"\n"+j.ToString()+"\n"+h.ToString());
                     }  
        } 
 }
}
            Console.ReadKey();
        }
    }


}
原创粉丝点击