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

PROGRAMMING:Supermarket decals

Luz5年前 (2021-05-10)题库597
A supermarket has a promotion method. If the purchase amount exceeds a certain threshold, a decal will be given randomly. There are different kinds of decals, which are represented by numbers. The number is a number between 1 and 100. When three consecutive numbers of flowers are collected, a small gift can be exchanged.
Xiao Ming often goes shopping in a supermarket and has accumulated a lot of decals. You can help him see how many small gifts he can exchange.
###Input format:
The first is a positive integer n (1 < n < 100), which indicates the number of decals on Xiaoming's hand.
Then there are n positive integers PI (1 < = Pi < = 100), and each number represents the number of a decal.
###Output format:
Output a number indicating the number of small gifts Xiao Ming can exchange. If you can't change a small gift, output 0.
###Input example:
```in
six
3 2 4 6 6 4
```
###Output example:
```out
one
```
*2 3 4 is a combination, and the remaining 4 6 6 are not consecutive numbers*







answer:If there is no answer, please comment