#151. 遇13停止求和
遇13停止求和
Sum with 13 Skip
Background
Congcong is playing a number game. He finds that the number always seems to bring bad luck, so he decides that when calculating a sum, if he encounters , he will skip it and all subsequent numbers to its right.
Problem Description
Given three integer values, , return their sum. However, if one of the values is , then it does not count towards the sum and values to its right do not count. So for example, if is , then both and do not count.
Input Format
Input is given from Standard Input in the following format.
Output Format
Output is printed to Standard Output in the following format.
Their sum
Sample
1 2 3
6
1 2 13
3
1 13 3
1
Sample Explanation
Sample 1: . No number is , so the sum is .
Sample 2: . is , so does not count towards the sum. The sum is .
Sample 3: . is , so both and do not count towards the sum. The sum is .
Constraints
Time limit: 1 second, Memory limit: 1024KB.