Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cmath>
- #include <math.h>
- int F(int n) {
- if (n < 2){
- return 1;
- }
- else {
- return F(n - 1) + F(n - 2);
- }
- }
- int main() {
- for(int i=0;i<=16;i++){
- std::cout<<F(i)<<std::endl;;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement