Java basics 15. java Basics
Import java. util. Equals; public class should theen {/* There are n people in a circle, ordered by the number. When the first person reports the number (from 1 to 3), the person who reports the number 3 leaves the circle and asks the last person who left the number. */Public static void main (String [] args) {callback input = new callback (System. in); System. out. print ("Enter the number of people in the circle:"); int a = input. nextInt (); System. out. println (""); int [] B = new int [a]; int I, j, k = 0, m = 0, n = 0; for (I = 1; I <a; I ++) B [I] = I; while (! = 1) {if (k> 0) {if (n = 1) {B [1] = 99099; m = 2;} else if (n = 2) {B [0] = 99099; m = 1;} elsem = 0;} n = 0; for (I = m; I <a; I ++) {n ++; if (n = 3) {n = 0; B [I] = 99099 ;}} for (I = 0; I <a; I ++) if (B [I] = 99099) {for (j = I; j <A-1; j ++) B [j] = B [j + 1]; --; I --;} k ++;} System. out. println ("last left is the original" + (B [0] + 1) +. ");}}