Sum Numbers But 5
Here's a basic challenge to get started.
In each test case, you will be given two numbers
b. The fiveless sum of a range of numbers is the sum of all the numbers from
b (inclusive) except for any multiple of 5. Print out the fiveless sum of each given pair of numbers.
For example, if you're given 1 and 6 as input, print out 16.
(1+2+3+4+6 = 16)
-10,000,000 < a < b < 10,000,000
You are provided with boilerplate code to process the input, but here's the format in case you want to do it yourself:
The first line contains
t for the number of test cases.
t lines follow which each contain one two integers
Output the fiveless sum for each pair of integers on its own line.
2 1 6 -7 17
Note: To pass the contest part in Ruby, you'll need to optimize your code a bit...
Print out the fiveless sum of each pair of numbers.
Please sign in or sign up to submit answers.
Alternatively, you can try out Learneroo before signing up.