Đọc hiểu code

View as PDF



Authors:
Problem types
Points: 3 Time limit: 1.0s Memory limit: 256M Input: stdin Output: stdout

Hôm nay khi trước khi đi học về, \(thầy\) \(Quang\) đã cho các bạn một bài tập là đọc hiểu code. \(Thầy\) \(Quang\) cho một đoạn code và yêu cầu các bạn đưa ra kết quả của bài toán.

    readln(n);
    s:=0;
    for i:=1 to n do s:=s+i;
    write(s);

Yêu cầu

  • Đưa ra kết quả bài toán đó.

Input

  • Một dòng duy nhất là số \(N\) \((N <= 10^9)\)

Output

  • Gồm một dòng duy nhất là kết quả bài toán.
Sample 1
Input
5
Output
15
Sample 2
Input
100
Output
5050

Comments

There are no comments at the moment.