#71. 跳过13及其后数字求和
跳过13及其后数字求和
Sum with Unlucky 13
Background
Congcong is playing a number game. He needs to calculate the sum of a series of numbers, but some numbers are considered unlucky and require special handling.
Problem Description
Return the sum of the numbers in the array, returning for an empty array.
Except the number is very unlucky, so it does not count and numbers that come immediately after a also do not count.
Input Format
Input is given from Standard Input in the following format.
A single line containing multiple integers, representing the elements of the array.
Output Format
Output is to be printed to Standard Output in the following format.
A single integer, representing the calculated sum.
Sample
1 2 2 1
6
1 1
2
1 2 2 1 13
6
Sample Explanation
For the sample input 1 2 2 1 13:
The numbers in the array are .
is counted. Current sum: .
is counted. Current sum: .
is counted. Current sum: .
is counted. Current sum: .
is unlucky and not counted.
The final sum is .
Constraints
Time limit: second, Memory limit: KiB for each test case.