B. [例4.11]数列求和

    Type: Default 1000ms 256MiB

[例4.11]数列求和

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

计算 1+2+3++(n1)+n1+2+3+\cdots+(n-1)+n 的值,其中正整数 nn 不大于 100。由于你没有高斯聪明,所以你不被允许使用等差数列求和公式直接求出答案。

输入格式

输入一个正整数 nn

输出格式

输出一个正整数,表示最后求和的答案。

样例 #1

样例输入 #1

100

样例输出 #1

5050

提示

数据保证,1n1001 \leq n \leq 100

2024-5 龙凤苑中学B班5.28

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2024-5-28 16:15
End at
2024-6-1 16:15
Duration
96 hour(s)
Host
Partic.
16