Programming contests

50 Programming Exercise for Beginners

January 2, 2019, 12:00 AM – December 31, 2019, 12:00 AM

The Biggest

Write a program that reads integers from the standard input. The first number of each line determines how many additional numbers are given in that line.
For each line, the program should write to the standard output how many times the biggest number occurs from the second number to the end of the line.
The input is terminated by a line containing only one 0, this line should not be processed by the program.

Sample Input

  1. 10 5 2 3 5 4 1 3 5 1 3
  2. 1 1
  3. 5 5 5 5 5 5
  4. 3 1 2 3
  5. 0
download as text file

Output for Sample Input

  1. 3
  2. 1
  3. 5
  4. 1
download as text file
Acknowledgement This work was supported by the construction EFOP-3.4.3-16-2016-00021. The project was supported by the European Union, co-financed by the European Social Fund.
University of Debrecen; Faculty of Informatics; v. 09/30/2024