第3题求解
展开全部
public class ChookAndRabbit {
public static void main(String[] args) {
int chookNum = 0;
int rabbitNum = 0;
for(;chookNum<35;chookNum++){
rabbitNum = 35-chookNum;
if(chookNum*2+rabbitNum*4==94){
System.out.println("鸡:"+chookNum+",兔:"+rabbitNum);
}
}
}
}
public static void main(String[] args) {
int chookNum = 0;
int rabbitNum = 0;
for(;chookNum<35;chookNum++){
rabbitNum = 35-chookNum;
if(chookNum*2+rabbitNum*4==94){
System.out.println("鸡:"+chookNum+",兔:"+rabbitNum);
}
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询