###Puzzle Have the function SimpleAdding(num) add up all the numbers from 1 to num. For the test cases, the parameter num will be any number from 1 to 1000
def SimpleAdding(num)
# code goes here
sum = (1..num.to_i).inject {|sum, n| sum + n}
#sum = (1..num.to_i).reduce(:+)
return sum
end
# keep this function call here
# to see how to enter arguments in Ruby scroll down
puts SimpleAdding(STDIN.gets)