/*
Enter the integers between 1and100: 2565432343202 occurs 2times.
3 occurs 1times.
4 occurs 1times.
5 occurs 2times.
6 occurs 1times.
23 occurs 1times.
43 occurs 1times.
*/
import java.util.Scanner;
import java.util.Arrays;
public class OcussDigitSeconds {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
final int SIZE = 20;
int i = 0;
int[] number = new int[SIZE];
int temp;
System.out.print("Enter the integers between 1 and 100: ");
while (i < SIZE && (temp = input.nextInt()) != 0) {
if (temp > 0 && temp < 100)
number[i++] = temp;
}
final int LEN = i;
Arrays.sort(number, 0, LEN);
intindex = 0;
int[] times = new int[LEN];
for (i = 0; i < LEN; i++) {
times[index] = 1;
while (number[i] == number[i + 1]) {
times[index]++;
i++;
}
index++;
}
for (i = 0, index = 0;i < LEN; i += times[index], index++)
System.out.println(number[i] + " occurs " + times[index] + " times.");
}
}