<span style= "FONT-SIZE:18PX;" >package Lianx;
public class Monkeytao {
static int ts=0;//peach Total
int fs=1;//record number of times
static int hs=5;//Monkey number ...
The range of the number of peaches in int tsscope=5000;//. Too big to overflow.
public int FT (int t) {
if (t==tsscope) {
//) cancels recursive
System.out.println ("End") when the peach number is the largest range of values;
return 0;
} else{
if ((t-1)%hs==0 && fs <=hs) {
if (fs==hs) {
System.out.println ("Peach number =" +ts + "satisfies the peach condition"); c14/>}
fs+=1;
Return ft ((t-1)/5*4); Back to the monkey to take away a copy of the remaining total
}else{
//
The number of times that did not meet the condition fs=1;//score was reset to 1 returns
ft (ts+=1);// Peaches number plus +1}} public
static void Main (string[] args) {
new Monkeytao (). FT (0);
}
} </span>