1. Chicken and rabbit cage, a total of 30 head, 88 feet. How many chickens and rabbits are there in the cage?
2. Chicken Rabbit with Cage, a total of 48, feet 132, how many chickens and rabbits?
3. A breeding group altogether raises the chicken, the rabbit 78, altogether has 200 feet, asks the rearing group raises the chicken and the rabbit each how many only?
4. The chicken rabbit with the cage does not know the number, 36 head cage in Dew. A total of 50 pairs of feet, how many chickens and rabbits each?
ImportJava.util.Scanner; Public classChickenandrabbit { Public Static voidMain (string[] args) {System.out.println ("Chicken and rabbit cage problem"); @SuppressWarnings ("Resource") Scanner SC=NewScanner (system.in); System.out.println ("Please enter the number of headers:"); intTou =Sc.nextint (); System.out.println ("Please enter the number of legs:"); intTUI =Sc.nextint (); for(intj = 1;j<=tou;j++){ for(intt = 1;t<=tou;t++){ if(j + t = = Tou && 2*j + 4*t = =tui) {System.out.println ("The number of chickens is:" +j); System.out.println ("The number of rabbits is:" +t); } } } }}
Chicken and rabbit cage problem