John got a bad mark in math. The teacher gave him another task. John is to
write a program which computes the sum of integers from 1 to . If he
manages to present a correct program, the bad mark will be cancelled.
Task
Write a program which:
reads the number from the standard input,
computes the sum of integers from 1 to ,
writes the answer to the standard output.
Input
The first and only line of the standard input contains one integer
().
Output
One integer is to be written to the standard output. This integer should
be the sum of integers from 1 to .
Example
For the input data:
3
the correct result is:
6
Task author: Piotr Stanczyk.
Kontakt
W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem szkopul@fri.edu.pl.
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, odwiedź nasze serwery na Discordzie. Są one moderowane przez społeczność, ale członkowie zespołu wsparcia również aktywnie się tam udzielają.