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++: #include<stdio.h>

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

C++: #include <cstdio>

using namespace std;

int sum = 0;

int fib( int n ){

    if( n >= 0) {

        if( n == 0 || n == 1 ){

            return 1;

        } else {

            sum = fib( n - 1 ) + fib( n - 2 );        

        }

    } else return 0;

    return sum;

}

int main(){

    int n;

    scanf("%d", &n);

    int ans = fib(n);

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

}

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

int Fib(int n){
	double phi = (1+sqrt(5))/2;
	return floor(pow(phi,n)/sqrt(5) + 0.5 );
}

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

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define  all(x) (x).begin(),(x).end()
typedef long long ll;

int f[45];

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

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

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

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

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

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;
  
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;

long long FibonacciNumber(long long n, long long mod) {
    long long A[2][2] = {{1, 1}, {1, 0}};
    long long M[2][2] = {{1, 0}, {0, 1}};
    while (n > 0) {
        if (n & 1) {
            long long M_00 = M[0][0] * A[0][0] + M[0][1] * A[1][0];
            long long M_01 = M[0][0] * A[0][1] + M[0][1] * A[1][1];
            long long M_10 = M[1][0] * A[0][0] + M[1][1] * A[1][0];
            long long M_11 = M[1][0] * A[0][1] + M[1][1] * A[1][1];
            M[0][0] = M_00 % mod;
            M[0][1] = M_01 % mod;
            M[1][0] = M_10 % mod;
            M[1][1] = M_11 % mod;
        }
        long long A_00 = A[0][0] * A[0][0] + A[0][1] * A[1][0];
        long long A_01 = A[0][0] * A[0][1] + A[0][1] * A[1][1];
        long long A_10 = A[1][0] * A[0][0] + A[1][1] * A[1][0];
        long long A_11 = A[1][0] * A[0][1] + A[1][1] * A[1][1];
        A[0][0] = A_00 % mod;
        A[0][1] = A_01 % mod;
        A[1][0] = A_10 % mod;
        A[1][1] = A_11 % mod;
        n >>= 1;
    }
    return M[1][0];
}

int main() {

    ll n; cin >> n;
    cout << FibonacciNumber(n + 1, 1e18) << endl;
   
    return 0;
}

C++: #include <vector>
#include <iostream>
#include <algorithm>

int main() {
    int n;
    std::cin >> n;
    std::vector<int> vec(n+1, 0);
    vec[0] = 1;
    vec[1] = 1;
    for (int i = 2; i <= n; i++) {
        vec[i] = vec[i-1] + vec[i-2];
    }
    std::cout << vec[n] << std::endl;
}

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

int main() {
  int n;
  cin >> n;

  vector<int> fib(n+2);
  fib[0] = 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++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
//#include "MyMath.h"
//#include "MyDisjointset.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string.h>
using namespace std;
typedef pair<int, int> P; typedef long long int ll;
const int INF = 100000000;
int mod = 10000;
vector <vector<int>> mul(vector<vector<int> > f, vector<vector<int> > s) {
	vector<vector<int> > res(2, vector <int> (2) );
	res[0][0] = (f[0][0] * s[0][0] + f[0][1] * s[1][0]) % mod;
	res[0][1] = (f[0][0] * s[0][1] + f[0][1] * s[1][1]) % mod;
	res[1][0] = (f[1][0] * s[0][0] + f[1][1] * s[1][0]) % mod;
	res[1][1] = (f[1][0] * s[0][1] + f[1][1] * s[1][1]) % mod;
	return res;
}
int main() {
	int n; cin >> n;
	vector<vector<int> > base(2, vector<int> (2) );
	base[0][0] = 1;
	base[0][1] = 1;
	base[1][0] = 1;
	base[1][1] = 0;
	vector<vector<int> > ans(2, vector<int>(2));
	ans[0][0] = 1;
	ans[0][1] = 0;
	ans[1][0] = 0;
	ans[1][1] = 1;
	while (n > 0) {
		if (n & 1) ans = mul(ans, base);
		//cout << ans[0][0] << " " << ans[0][1] << endl;
		//cout << ans[1][0] << " " << ans[1][1] << endl;
		//cout << endl;
		base = mul(base, base);
		n >>= 1;
	}
	cout << ans[1][0] + ans[1][1]  << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,dp[45]={1,1};
  cin >> n;
  for(int i = 2 ; i <= n ; i++ ) dp[i] = dp[i-1] + dp[i-2];
  cout << dp[n] << endl;
return 0;
}

C++: /*
 * Problem Description: Dynamic Programming - Fibonacci Number
 * Category:
 * Author: Khan
 * Date: 18th October, 2017
 */

#include <iostream>

using namespace std;

int n;
int Fibonacci[45];

int main(int argc, char const *argv[])
{
    //freopen("sample.txt", "r", stdin);
    cin >> n;
    Fibonacci[0] = 1;
    Fibonacci[1] = 1;
    for (int i = 2; i <= n; ++i)
    {
        Fibonacci[i] = Fibonacci[i - 1] + Fibonacci[i - 2];
    }
    cout << Fibonacci[n] << endl;
    return 0;
}