THE EXERCISE OF THE GUYS GUYS HAS BEEN MOVED TO THE MENU "EXERCISE OF Teacher"

Count the number of Advanced

Threads: For an array of n integers. Plate count in how many different numbers and each number appears many times in the array. The number in the array is between 0 come 1000. n <= 100.
Input: The first line is an integer n. The second line 2 n is an integer array, of numbers separated by spaces.
Output: The first line contains the number m is the number of different, Next m lines each containing 2 numbers separated by spaces, respectively, and the amount of occurrence of which. m it appears in the order so that the correct number order as the original sequence.
For example:

input:
4
4 3 3 2
output:
3
4 1
3 2
2 1

You are not logged in? Log in to Submit Now!

14 Comments

Add a Comment