C++ Read In Array with Fewer than 50 integers, sort, print Unique numbers and there number of occurrences.

LANGUAGE: C++

CHALLENGE:

C++ Write a program that reads in an array of type int. You may assume that there are fewer than 50 entries in the array. Your program determines how many entries are used. The output is to be a two-column list. the first column is a list of the distinct array elements; the second column is the count of the number of occurrences of each element . the list should be sorted on entries int he first column, largest to smallest.

SAMPLE DATA:

Test Array Values:          -12 3 -12 4 1 1 -12 1 -1 1 2 3 4 -12

SAMPLE OUTPUT:

NCount
42
33
22
14
-11
-124

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,