Java basics 12: java Basics
Public class Twelfth {/* There are a bunch of peaches on the beach, and five monkeys can score points. The first monkey divided the pile of peach creden into five portions, one more. The monkey threw the other one into the sea and took one. The second monkey divides the remaining peaches into five equal portions and adds one more portion. It also throws one more portion into the sea and takes one portion, the third, fourth, and fifth monkeys did this. How many peaches did they have on the beach? */Public static void main (String [] args) {int a = 0, flag = 0, B, I = 1; while (! =-1) {B = a; if (1.0*(A-1)/5*4 = (A-1)/5*4) {while (I <= 5) {a = (A-1)/5*4; if (1.0 * (A-1)/5*4! = (A-1)/5*4) break; I ++ ;}} if (I = 5) flag = 1; if (flag = 1) {a = B; break;} I = 1; a = B; a ++; // System. out. println (a);} System. out. println ();}}