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

PROGRAMMING:Xiaoming's candy

Luz5年前 (2021-05-10)题库637
Xiao Ming likes candy very much.
One day, he took out * * n * * boxes, the first box contained * * 1 * * candy, the second box contained * * 2 * * candy, and so on, the nth box contained * * n * * candy.
However, the mischievous little red messed up the order of all the boxes and took one. Xiao Ming wants to know how many sweets are in the box Xiao Hong took away?
###Input format:
In the first line, enter a positive integer * * n * * to represent the total number of boxes. In the second line, enter * * n-1 * * positive integers * * AI * * to represent the current number of candy in each box( 0<=n,ai<=10000)
###Output format:
Output a positive integer representing the number of candy in the box taken by Xiao Hong.
###Input example:
Here is a set of inputs. For example:
```in
five
2 5 1 3
```
###Output example:
The corresponding output is given here. For example:
```out
four
```
Description: there are 5 boxes at the beginning, each box has 1, 2, 3, 4 and 5 candies respectively. What Xiao Hong took was the fourth box.







answer:If there is no answer, please comment