# 求数列的第n项的值

已知数列:2,4,4,4,6,6,6,6,6,8,8,8,8,8,8,8,...求第n项的值

## template

```cpp
#include <iostream>
int main()
{
	unsigned int N;
	std::cout << "Please enter the value of N: ";
	std::cin >> N;
	if (N % 2 != 0)
	{
		std::cout << "Please enter an even number greater than zero!" << std::endl;
		return -1;
	}
	int oddCount = 1;
	int printCount = 0;
	for (int i = 2; i <= N; i += 2)
	{
		for (int j = 0; j < oddCount; j++)
		{
			std::cout << i << " ";
			printCount++;
			if (printCount == N)
			{
				std::cout << "<---这个就是第N = " << N << "个数。" << std::endl;
				return 0;
			}
		}
		oddCount += 2;
	}
	return 0;
}
```

## 答案

```cpp

```

## 选项

### A

```cpp

```

### B

```cpp

```

### C

```cpp

```