Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int F(int n) {
- if (n == 1) {
- return 1;
- }
- if (!(n & 1)) {
- return n + F(n - 1);
- }
- if (n & 1) {
- return 2 * F(n - 2);
- }
- }
- int main() {
- cout << F(26);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment