1.
The first is to identify the occurrence frequency of each ID for loop by two, and then determining ID number is greater than half of the ID number.
package test2;
import java.util.Scanner;
test1 {class public
public static void main (String [] as AGRS) {
Scanner Scanner new new SC = (the System.in);
of System.out.print ( "Please enter the number of the ID:");
int NUM = sc.nextInt ( );
// number of guaranteed valid input
int D1 = 0;
int [] = a new new int [NUM]; // the ID number is stored in an array
int I, C;
// All the input ID number
for (i = 0 ; I <NUM; I ++) {
C = I +. 1;
of System.out.print ( "Please enter" + c + "th ID number:");
A [I] = sc.nextInt ();
}
int []d=new int[num];
for(i=0;i<num;i++) {
int f=0;
for(int ii=0;i<num;i++) {
a[i]=a[ii];
f++;
if(f>num/2)
{
d1=a[i];
}
}
}
System.out.println ( "King water ID is:" + D1);
}
}