We can solve the problem with summing up numbers in the following way:
- We read the input number
- We initially start with a sum
sum = 0.
- We run a loop from 1 to
n. On each step of the loop, we read the a number
numand add it to the sum
- Finally, we print the calculated amount
Below is the source code for the solution:
Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/510#3.