编程知识 cdmana.com

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

【 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 .

版权声明
本文为[CSDN Q & A]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/12/20211207200639049k.html

Scroll to Top