MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / main

Function main

codes/cpp/Code_4_06_2.cpp:6–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4int N, a[10000009];
5
6int main() {
7 cin >> N;
8 a[1] = 1; a[2] = 1;
9 for (int i = 3; i <= N; i++) a[i] = (a[i - 1] + a[i - 2]) % 1000000007;
10 cout << a[N] % 1000000007 << endl;
11 return 0;
12}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected