Toggle navigation
万里ACM
F.A.Qs
Web Board
ProblemSet
Source/Category
Status
Ranklist
Contest
[
ProblemSet
Status
Ranklist
OI Ranklist
Statistics
]
Login
Problem D: 【循环结构-迭代】求和
Problem D: 【循环结构-迭代】求和
Time Limit:
1 Sec
Memory Limit:
128 MB
Submit:
964
Solved:
758
[
Submit
] [
Status
] [
Web Board
] [Creator:
]
Description
已知数列
a
1
=1
a
2
=1+2
a
3
=1+2+3
a
4
=1
+2+3+4
......
输入正整数n(n≤100),
计算a
1
+a
2
+a
3
+a
4
+......+a
n
的累加和并输出。
Sample Input
Copy
5
Sample Output
Copy
35