-->
当前位置:首页 > 题库

PROGRAMMING:Guess the number

Luz5年前 (2021-05-10)题库489
A group of people sitting together, each guess a number within 100, who's number is closest to half of the average to win. This question asks you to find the winner.
###Input format:
Enter a positive integer n ($$$Le 10 ^ 4 $$) on the first line. Then n lines, each line gives a player's name (a string of no more than 8 English letters) and a positive integer ($$$Le $$100) that he guessed.
###Output format:
Output in one line: half of the average (only integer part) and the winner's name, separated by spaces. The title guarantees that the winner is the only one.
###Input example:
```in
seven
Bob 35
Amy 28
James 98
Alice 11
Jack 45
Smith 33
Chris 62
```
###Output example:
```out
22 Amy
```







answer:If there is no answer, please comment