Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

C++: #include <stdio.h>
int dp[50];
int fib(int n){
    if(n==0 || n==1) return dp[n]=1;
    else if(dp[n] != -1) return dp[n];  //已经计算过，直接返回结果，不重复计算
    else return dp[n] = fib(n-1) + fib(n-2);  //dp[n]记录fib(n)的值
}
int main(){
    int n;
    scanf("%d",&n);
    for (int i=0; i<50; i++) {
        dp[i] = -1;  //初始化为未计算
    }
    printf("%d\n",fib(n));
}

C++: #include <iostream>

long long int Fibo(int n)
{
    long long int a = 1;
    long long int pre = 1;
    long long int prepre = 1;
    for(int i = 2; i <= n; ++i){
        a = pre + prepre;
        prepre = pre;
        pre = a;
    }
    return a;
}
int main(){
    int n;
    std::cin >> n;
    std::cout << Fibo(n) << std::endl;
    return 0;
}

C++: #include <iostream>
#include <bits/stdc++.h>
#define MAX_SIZE 500010
#define INFTY 2000000000
using namespace std;

int D[MAX_SIZE];


int fib(int n) {
    if (D[n] > 0) {
        return D[n];
    }
    if (n <= 1) {
        return 1;
    }
    D[n] = fib(n -1) + fib(n - 2);
    return D[n];
}

int main(){
    int n;
    cin >> n;
    cout << fib(n) << endl;
}

C++: #include <iostream> 
#include <queue>
#include <string>
#include <set>
using namespace std;
int f(int n)
{
	if(n == 0)
	{
		return 1;
	}
	if(n == 1)
	{
		return 1;
	}
	return f(n-1)+f(n-2);
};

int main()
{
	int n;
	cin >> n;
	cout << f(n) << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
  int n; cin >> n;
  long long int fib[n];
  fib[0]=1; fib[1]=1;
  for(int i=2; i<=n; i++){
    fib[i]=fib[i-1]+fib[i-2];
  }

  cout << fib[n] << endl;

  return 0;
}

C++: /*
    ????????°??§???????????¨????????????
*/

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <float.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
#include <vector>
#include <map>
#include <utility>
#define LLU unsigned long long int
#define LL long long int
#define LD long double
using namespace std;
#define Lfmax DBL_MAX
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
#define vd vector<int>
#define vLL vector<long long int>
#define vLLU vector<unsigned long long int> 
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define debug printf("asd\n")
#define debugd(a) printf("--%d\n",a)
#define debugdd(a,b) printf("--%d %d\n",a,b)
#define debugarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i]);printf("\n")
#define newline printf("\n")
#define forin(a,b,c) for(int a=b ; a<c ; a++)
#define forde(a,b,c) for(int a=b ; a>=c ; a--)


inline void scd(int &a){scanf("%d",&a);}
inline void scdd(int &a,int &b){scanf("%d %d",&a,&b);}
inline void sctd(int &a,int &b,int &c){scanf("%d %d %d",&a,&b,&c);}
inline void scdlld(LL &a,LL &b){scanf("%I64d %I64d",&a,&b);}
inline void sclld(LL &a){scanf("%I64d",&a);}

#define scarrd(a,b) for(int index=0 ; index<b ; index++)scanf("%d",&a[index])
#define prdlld(a,b) printf("%I64d %I64d",a,b)
#define prdd(a,b) printf("%d %d",a,b)
#define prd(a) printf("%d",a)
#define prarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i])
#define iniarr(a,b) for(int i=0 ; i<b ;i++)a[i]=0
#define arr(a,b) int *a=(int *)malloc(b*sizeof(int))
#define llarr(a,b) long long int *a=(long long int *)malloc(b*sizeof(long long int))
#define st(a,b) char *a=(char *)malloc(b*sizeof(char))
#define grav 9.8
#define pi 3.14159265

int fbc[200000];

int fb(int a)
{
	//if(fbc[a]>0)
	//return fbc[a];
	
	
	if(a<2)
	return 1;
	
	//fbc[a]=fb(a-1)+fb(a-2);
	return fb(a-1)+fb(a-2);
	
}

int main()
{
	//iniarr(fbc,200000);
	int a;
	scd(a);
	printf("%d\n",fb(a));	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int F[50];
    F[0]=1;
    F[1]=1;
    for(int i=2;i<=n;++i)F[i]=F[i-1]+F[i-2];
    cout<<F[n]<<endl;
 	return 0;
}

C++: #include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>

#include <cstdio>

using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrep1(i, s, n) for (int i = (s); i >= (n); i--)
#define print_array(ary, size) cout << ary[0]; rep1(i, 1, size - 1) cout << ' ' << ary[i]; cout << endl;
typedef long long ll;
typedef unsigned long long ull;

int a[45];

int main()
{
	int n;

	a[0] = 1;
	a[1] = 1;
	rep1(i, 2, 44) a[i] = a[i - 1] + a[i - 2];

	cin >> n;
	cout << a[n] << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;

// ?????£??????????????°???????±???????
int fibonacci(int n);
int fib[45];

int main()
{
    int num;
    cin >> num;
    int res = 0;

    res = fibonacci(num);
    cout << res << endl;

    //getchar();
    //getchar();

    return 0;
}

int fibonacci(int n)
{
    if(n == 0 || n == 1) { return 1; }
    //return fibonacci(n - 1) + fibonacci(n - 2);
    if(fib[n]) { return fib[n]; }
    return fib[n] = fibonacci(n-1) + fibonacci(n-2);
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

vector<int> f(100, -1);

int fib(int n) {
    if (n == 0) return 1;
    if (n == 1) return 1;
    if (f[n] != -1) return f[n];
    f[n] = fib(n - 1) + fib(n - 2);
    return f[n];
}

int main() {
    int n;
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}

C++: =

C++: #include<iostream>

using namespace std;

int n;
int dp[44];

int main(){
    cin >> n;
    dp[0] = 1;
    dp[1] = 1;
    for(int i=2;i<=n;i++){
        dp[i] = dp[i-1] + dp[i-2];
    }
    cout << dp[n] << endl;
    return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
	int x = 1, y = 1, n, value = 0;
	cin >> n;

	if (n == 0 && n == 1) value = 1;
	else
	{
		while (n > 1)
		{
			value = x + y;
			x = y;
			y = value;
			n--;
		}
	}
	cout << value << endl;

	return 0;
}