码迷,mamicode.com
首页 > 其他好文 > 详细

鸡兔同笼

时间:2017-06-15 00:48:43      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:oid   ring   auth   []   style   pre   ++   ati   sys   

package wkx20170418;

/**
 * @author 鸡兔同笼
 */
public class Rabbit {

    public static void main(String[] args) {
        int chookNum, rabbitNum = 0;
        for (chookNum = 0; chookNum <= 35 && chookNum >= 0; chookNum++) {
            rabbitNum = 35 - chookNum;
            if ((2 * chookNum + 4 * rabbitNum) == 94) {
                break;
            }
        }
        System.out.println(chookNum + "," + rabbitNum);

    }

}

 

鸡兔同笼

标签:oid   ring   auth   []   style   pre   ++   ati   sys   

原文地址:http://www.cnblogs.com/lanseyitai1224/p/7011535.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!