public class A01 { public static void main(String[] args) { // TODO Auto-generated method stub for (int i = 0; i < 35; i++) { int Rabbit = 35 - i; if (i * 2 + Rabbit * 4 == 94) { System.out.println("鸡:"+i + "\t兔子" + Rabbit); } } } }
java-第六章-for-解决鸡兔同笼问题,布布扣,bubuko.com
时间: 2024-12-29 06:16:26