Given n integers, please count the number of occurrences of each integer and output it in the order of occurrence from more to less.

CSDN Q & A 2022-01-15 02:40:29

【 Problem description 】
Given n It's an integer , Please count the number of occurrences of each integer , Output in the order of more or less occurrences .
【 Input form 】
The first line contains an integer n, Represents the number of given numbers : The second line contains n It's an integer , Adjacent integers are separated by a space , Represents the given integer .
【 Output form 】
The output has multiple lines , Each line contains two integers , Represents a given integer and the number of times it occurs . Output in decreasing order of occurrence . If two integers appear the same number of times , Then output the smaller value first , Then the output value is larger .


thank
Similar articles

2022-01-15

2022-01-15