2020-10-07

package asd3;

public class Demo3 { public static void main(String[] args) { for (int a = 4; a<= 20; a++) { for (int b = 3; b <= a-1; b++) { for (int c = 2; c <= b-1; c++) { for (int d =1 ; d <=c-1; d++) { if (1.0/a+1.0/b+1.0/c+1.0/d== 1) { System.out.println("starting with"+a+"person"+"after the first round"+b+"person"+"after the second round"+c+"person"+"after the third round"+ d+"people"+"0 people after the fourth round"); } } } } } } }













Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325355075&siteId=291194637