已经解决!如下
question:
Problem 2 Make a program that accepts a number as input, and outputs the sum of a series
of numbers (1,2,3,4,5....) up to the input number.
Key:
print "Sum number:"
n = gets.to_i
s=0
for i in 1..n
s=s+i
end
puts s
Thank you for your concern!