Posted by felipe tonello on Fri 30 Jan 05:01
report abuse | download | new post
- #include
- #include
- int F(int n)
- {
- if (n == 0) return 0;
- if (n == 1) return 1;
- return F(n - 1) + F(n - 2);
- }
- int main(int argc, char *argv[])
- {
- int n = atoi(argv[1]);
- std::cout << F(n) << std::endl;
- return 0;
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.