이 튜토리얼에서는 시리즈 0, 7, 8, 33,51, 75, 102, 133...
이를 위해 번호가 제공됩니다. 우리의 임무는 특정 위치에서 주어진 시리즈에 대한 용어를 찾는 것입니다.
예시
#include <iostream>
#include <math.h>
using namespace std;
//calculating nth term of series
int nthTerm(int n) {
return 2 * pow(n, 2) + n - 3;
}
int main() {
int N = 4;
cout << nthTerm(N) << endl;
return 0;
} 출력
33