Go: package main

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

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

C++: //
// Created by 李青坪 on 2018/10/28.
//

#include <cstdio>
#include <algorithm>
#define MAXN 44
#define NIL -1
using namespace std;

int value[MAXN];

int fibonacci(int n){
    if (n == 0 || n == 1) {
        value[n] = 1;
        return 1;
    }
    if (value[n-1] != NIL && value[n-2] != NIL){
        return value[n-1] + value[n-2];
    }
    if (value[n-1] != NIL && value[n-2] == NIL){
        return value[n-1] + fibonacci(n-2);
    }
    if (value[n-1] == NIL && value[n-2] != NIL){
        return fibonacci(n-1) + value[n-2];
    }
    return fibonacci(n-1) + fibonacci(n-2);
}

int main(){
    fill(value, value+MAXN, NIL);
    int n;
    scanf("%d", &n);
    printf("%d\n", fibonacci(n));
}

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

#if 0
int Fibonatch(int result[], int num)
{
    int ret = result[num];

    if (ret == 0) {
        if (num > 1) {
            ret = Fibonatch(result, num - 1) + Fibonatch(result, num - 2);
        }
        else {
            ret = 1;
        }
        result[num] = ret;
    }

    return ret;
}

int main(void)
{
    int num;
    int ret[45] = {0};
    int result;

    scanf("%d", &num);
    result = Fibonatch(ret, num);

    printf("%d\n", result);

    return 0;
}
#else

int Fibonatch(int num)
{
    int i;
    int result[45];

    result[0] = result[1] = 0;
    for (i = 2; i <= num; i++) {
        result[i] = result[i - 1] + result[i - 2];
    }

    return result[num];
}

int main(void)
{
    int num;
    int result;

    scanf("%d", &num);

    result = Fibonatch(num);
    printf("%d\n", result);

    return 0;
}

#endif

C++: #include <bits/stdc++.h>
using namespace std;
void fib(int *a, int n)
{
    a[0] = 1;
    a[1] = 1;
    for (int i = 2; i <= n; ++i)
    {
        a[i] = a[i - 2] + a[i - 1];
    }
}
int main()
{
    int n;
    cin >> n;
    int a[n + 1] = {};
    fib(a, n);
    cout << a[n] << endl;
}

C++: #include <cstdio>

int main()
{
	int f[50]= {1, 1, 2};
	int n;
	scanf("%d", &n) ;
	for (int i = 3; i <= n; ++i)
		f[i] = f[i-1] + f[i-2];
	printf("%d\n", f[n]);
	
	return 0;
}

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

int main(){
  int fibo[MAX];
  int n;
  fibo[0] = fibo[1] = 1;
  for(int i = 2; i < MAX; i++)
    fibo[i] = fibo[i-1] + fibo[i-2];

  cin >> n;
  cout << fibo[n] << endl;
}

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

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

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

vector<int> fibonatti;
int dp[10000];
int calc(int n){
  if(n <= 1) return 1;
  if(dp[n] != -1)return dp[n];
  fibonatti[n] = calc(n - 1) + calc(n - 2);
  return dp[n] = fibonatti[n];
}

int main(int argc, char *argv[]){
  int n;
  cin >> n;
  fibonatti.resize(n);
  fibonatti[0] = fibonatti[1] = 1;
  for (int i = 0; i <= n; i++) {
    dp[i] = -1;
  }
  dp[0] = dp[1] = 1;
  std::cout << calc(n) << std::endl;
  for (int i = 0; i < n; i++) {
    std::cout << dp[i] << " ";
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)

int f[45];

void FibonacciInit(){

    f[0] = 1;
    f[1] = 1;
    for(int i=2; i<=44; i++){
        f[i] = f[i-1] + f[i-2];
    }
}

int main() {

    int n;
    cin >> n;

    FibonacciInit();

    cout << f[n] << endl;

    return 0;
}

C++: #include <iostream>

using namespace std;


int fib(int n){
  if(n<0){
    return 0;
  }
  if(n==1||n==2){
    return 0;
  }
  return fib(n-1)+fib(n-2);

}

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

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

int main() {
  int n;
  cin >> n;
  int F[50];
  F[0] = 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 <stdio.h>

int fibonacci(int);
int F[45];

int main(){
  int n;

  scanf("%d",&n);
  printf("%d\n",fibonacci(n));

  return 0;
}

int fibonacci(int n){
  int i;

  for(i=0;i<45;i++) F[i]=-1;
  
  if(n==0||n==1) return F[n]=1;
  if(F[n]!=-1) return F[n];
  return F[n]=fibonacci(n-2)+fibonacci(n-1);
}

C++: #include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int dp[50];

int main(){
  int n;cin>>n;
  dp[0]=1;
  dp[1]=1;
  rep1(i, n){
    dp[i+1] = dp[i-1]+dp[i];
  }

  cout<<dp[n]<<endl;

  return 0;
}

C++: #include <stdio.h>

using namespace std;

long long Fibonacci[43] = {0};

long long fibo(int n){
	if(n == 0)	return 1;
	else if(n == 1)	return 1;
	else{
		if(Fibonacci[n-1] != 0 && Fibonacci[n-2] != 0){
			//Do nothing
		}else if(Fibonacci[n-1] != 0){
			Fibonacci[n-2] = fibo(n-2);
		}else if(Fibonacci[n-2] != 0){
			Fibonacci[n-1] = fibo(n-1);
		}else{
			Fibonacci[n-1] = fibo(n-1);
			Fibonacci[n-2] = fibo(n-2);
		}
		return Fibonacci[n-1] + Fibonacci[n-2];
	}
}

int main(){
	int n;
	scanf("%d",&n);
	printf("%lld\n",fibo(n));
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define MOD 1000000007 //S(vector).size()
using namespace std;
typedef long long ll;

int dp[50];

int main(void){
	int n;
	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 n;
    cin>>n;
    int sum[n+1];
    for(int i=0;i<=n;i++){
        if(i==0||i==1){
            sum[i]=1;
        }
        else{
            sum[i]=sum[i-1]+sum[i-2];
        }
    }
    cout<<sum[n]<<endl;
    return 0;
}