# 计算第n项的值

计算 s=(1+1)+(1+2)+(1+2+3)+````+(1+2+3+...+n) 第n项的值

## template

```cpp
#include <iostream>
using namespace std;
int main()
{
	int n; 
	static int	sum=1;
	cout << "请输入N：" << endl;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= i; j++)
		{
			sum = sum + j;
		}
	}
	cout << "结果为：" << sum;
	system("pause");
	return 0;
}
```

## 答案

```cpp

```

## 选项

### A

```cpp

```

### B

```cpp

```

### C

```cpp

```