#CCBCHBON0000023. Continue trong while (Continue in a While Loop)
Continue trong while (Continue in a While Loop)
Continue in a While Loop
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Sum the integers from 1 to that are not divisible by 3, using while-loop logic. Advance the counter before continue. The result for is 0.
Input
One integer .
Output
Print the sum of integers not divisible by 3.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
6
Output:
12
Explanation:
Sum numbers from 1 to 6 excluding multiples of 3: 12.
Example 2
Input:
0
Output:
0
Explanation:
Sum numbers from 1 to 0 excluding multiples of 3: 0.