Java——编程求解鸡兔问题,鸡兔共49只,但有100只腿,计算鸡和兔各多少只?

写这些博客主要是为了记录本身的程序之路java 代码以下:code public class Demo1{ public static void main(String args[]){ int x,y; for(x=1;x<49;x++){ y=49-x; if(2*x+4*y==100){ System.out.println("鸡:"+x); Syste
相关文章
相关标签/搜索