DWITE Online Computer Programming Contest
October 2005

Problem 3

Sum 'Em Up

Given two integers, determine the sum of the integers, between and including these two integers.

For example, given the two integers 6 and 12, the sum of the integers between and including these two integers is: 6+7+8+9+10+11+12=63.

The input will contain five lines of data. Each line will contain two integers m and n, -1000 ≤ m, n ≤ 1000. m ≠ n. The integers will be separated by a space.

The output will contain five lines of data, corresponding to the input. It will list the numbers from lowest to highest, each separated by a plus sign, +, and the equal sign, =, and the sum.

Sample Input (Only three lines given)

2 4
6 12
6 -3

Sample Output

2+3+4=9
6+7+8+9+10+11+12=63
-3+-2+-1+0+1+2+3+4+5+6=15

All Submissions
Best Solutions


Point Value: 5
Time Limit: 1.00s
Memory Limit: 32M
Added: Mar 06, 2009

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3