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 <iostream>

using namespace std;

int A[128];
int fib(int n){
  A[0] =1;
  for(int i=1;i<n;++i){
    A[i] =A[i-1];
    if(i>2)A[i]+=A[i-2];
    if(i>3)A[i]+=A[i-3];
  }
  return A[n-1];

}

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll tmp1,tmp2,tmp3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}
vector<ll> fib(100,-1);
ll calc_fib(ll k){
  if(fib[k] != -1){
    return fib[k];
  }
  fib[k] = calc_fib(k-1) + calc_fib(k-2);
  return fib[k];
}
int main(){
  fib[0] = 1;
  fib[1] = 1;
  ll n;
  cin >> n;
  rep(i,n){
    calc_fib(i);
  }
  cout << calc_fib(n) << endl;
}

C++: #include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
int main(){
  long long int i,n,dp[50];
  scanf("%lld\n",&n);
  dp[0]=1,dp[1]=1;
  for(i=2;i<=n;i++){
    dp[i]=dp[i-1]+dp[i-2];
  }
  printf("%lld\n",dp[n]);
  return 0;
}

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

#define MAX 45

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

int main()
{
    int C;

    cin >> C;

    //cout << fibonacci(C) << endl;

    int F[MAX];

    F[0] = 1;
    F[1] = 1;

    for (int i = 2; i < MAX; i++)
    {
        F[i] = F[i - 1] + F[i - 2];
    }

    cout << F[C] << endl;

    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <cstring>
 
typedef long long ll;

#define rep(i,n) for(ll i = 0; i < n; i++)
 
using namespace std;
 
const ll INF = ll(1e18)+1;
const double PI=3.14159265358979323846;

int dp[50];

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

C++: #include <iostream>
#include <vector>
using namespace std;
int fib(int x, vector<int>& f)
{
if (f[x-1] == -1) f[x-1] = fib(x-1, f);
if (f[x-2] == -1) f[x-2] = fib(x-2, f);
return f[x-1] + f[x-2];
}

int main()
{
int x; cin >> x;
vector<int> f(x+1, -1); f[0] = f[1] = 1;
cout << fib(x, f) << endl;
return 0;
}

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

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

    int first = 1;
    int second = 1;
    
    for (int i = 2; i < input; ++i) {
        int third = first + second;
        first = second;
        second = third;
    }
    cout << second << "\n";
    
    return 0;
}

C++: class RecursiveFibonacci:public Fibonacci{
public:
	virtual int calc(int x);
};

int RecursiveFibonacci::calc(int x){
	if(x == 0){
		return 0;
	}else if(x == 1){
		return 1;
	}else{
		return calc(x - 1) + calc(x - 2);
	}
}

C++: using namespace std;

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

    int first = 1;
    int second = 1;
    
    for (int i = 2; i < input; ++i) {
        int third = first + second;
        first = second;
        second = thid;
    }
    cout << second;
    
    return 0;
}

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

int fib(int n);

int main(){
	int n;
	cin >> n;
	cout << fib(n) << endl;
}
	
int fib(int n){
	int num1 = 1,num2 = 1;
	int temp = 0;
	if(n == 0 || n == 1) return 1;
	
	for (int i = 1;i < n;i++){
		temp = num2;
		num2 = num1 + num2;
		num1 = temp;
	}
		return num2;
}

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

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

	return 0;

}

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

int main(){
    int n;
    cin >> n;
    vector<long long> dp(n+1);
    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;
}

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

#define NIL -1

int dp[100];

int fib(int n){
    if(dp[n] == NIL) dp[n] = fib(n-1) + fib(n-2);
    return dp[n];
}

int main(){
    int n;
    cin >> n;
    for(int i=0; i<100; i++){
        dp[i] = NIL;
    }
    dp[0] = 1;
    dp[1] = 1;
    for(int i=0; i<n; i++){
        fib(i);
    }
    cout << fib(n) << endl;
}

C++: fibonacci :: Int -> Int
fibonacci = fibo (1, 1) 2
    where
      fibo :: (Int, Int) -> Int -> Int -> Int
      fibo (pp, prev) pos n
          | n < 2 = 1
          | pos >= n = pp + prev
          | otherwise = fibo (prev, pp+prev) (pos+1) n

main :: IO ()
main = do
  n <- readLn
  putStrLn $ show $ fibonacci n

C++: #include <stdio.h>

int dp[50];

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

int main()
{
    int n, i;
    for (i = 0; i < 50; i++)
        dp[i] = -1;

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

    return 0;
}

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

int F[45];

int fib(int x)
{
	if (F[x]) return F[x];
	if (x <= 1) return F[x] = 1;
	return F[x] = fib(x - 1) + fib(x - 2);
}

int main()
{
	int x;
	scanf("%d", &x);

	printf("%d\n", fib(x));

	return 0;
}

C++: #include<algorithm>
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
#define MAX 45
int F[MAX];


int fibonacci(int i){
    if(i == 1 || i == 0) return F[i] = 1;
    if(F[i]) return F[i];
    return F[i] = fibonacci(i-1) + fibonacci(i-2);
}

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

    cout << F[n] << endl;

    return 0;
}