Tips and Tricks

We can solve the problem with summing up numbers in the following way:

  • We read the input number n.
  • 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 num and add it to the sum sum.
  • Finally, we print the calculated amount sum.

Below is the source code for the solution:

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/510#3.

results matching ""

    No results matching ""