算法思想

本文探讨了如何利用计算机的超强计算能力解决复杂的数学难题,通过实例展示了使用计算机解决问题的简便性和效率。例如,寻找三个数的和等于输入数值的方法,纯数学解决非常困难,而借助计算机则变得简单易行。


一:Good at to take advantage of computer super calculate ability

       

        sametimes we use math to analyze and  resolve prolem very difficulty,

        if use computer , the problem can be very simple.beacuse we can use exhaustive method.

        we only need to find a  situation for satisfying the problemrequire.


         for example:       

             To find the numbers that them sum equal you input number

                if you use pure math to resolve  the problem it is  very difficulty.

                but now we can take advantage of computer super calculate ability,the problem can be so easy     

          public int AllCount(int sum) 
          {
               int count = 0;
               for(int i=0;i<=9;i++)
                   for(int j=0;j<=9;j++)
                      for(int k=0;k<=9;k++)
                      {
                          if ((i + j + k) == sum) //satisfy it require
                          { count++; }
                       }
                  return count;
           }


二:First Sort ,Then Calculate

     some problem  if you to sort it first ,it will becomes very simple



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值