鸡兔同笼问题

package com.Summer_0416.cn;

/**
 * @author Summer
 * 鸡兔同笼问题
 * 鸡和兔共计35只 一共有腿94只 问:共有多少只鸡和多少只兔子
 */
public class Test_Method12 {

    public static void main(String[] args) {
        int x = 0;//
        
        for ( x = 0; x <= 35; x++) {
            int y = 35-x;
            if(x*2+y*4==94){
                System.out.println("鸡"+x+"	兔"+y);
            }
        }

    }

}
原文地址:https://www.cnblogs.com/summerdata/p/10720382.html