1280: 求和

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:129 Solved:83

Description

给定一个正整数 $n$,求 $1+2+3+...+ n$ 。

请定义一个函数,能返回上面式子的结果。

函数格式如下:

int sum (int n)
注意:必须以递归调用的方式实现。

Input

一行,包含一个正整数 $n$。

Output

输出结果。

Sample Input Copy

4

Sample Output Copy

10

HINT

数据范围:

$3≤n≤100$。

Source/Category