Go: package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	m := make([]int, n+1)
	m[0] = 1
	m[1] = 1

	for i := 2; i <= n; i++ {
		m[i] = m[i-2] + m[i-1]
	}

	fmt.Println(m[n])
}

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;
}

C++: #include<iostream>
#include<vector>
using namespace std;
vector<int> memo;
int fib(int n){
    if(n==1||n==0){
        return 1;
    }
    if(memo[n]==-1){
        memo[n] = fib(n - 1) + fib(n - 2);
    }
    return memo[n];
}


int main(){
    int n ;
    cin >> n;
    memo = vector<int>(n + 1, -1);
    cout << fib(n)<<endl;
}

C++: #include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<int,int> P;
#define all(v) (v).begin(),v.end()
#define fi first
#define se second
const ll inf=(1e18);
const ll mod=1000000007;
ll dp[100];
ll fib(int n){
    if(n<2){
        return dp[n];
    }
    if(dp[n]!=-1)return dp[n];
    ll res=fib(n-1)+fib(n-2);
    return dp[n]=res;

}
int main(){
int n;
cin>>n;
fill(dp,dp+100,-1);
dp[0]=0;dp[1]=1;
cout<<fib(n+1)<<endl;

}

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

int n, d[50];

long long int fib(long long int k){
	if (!k || k == 1) return 1;
	if (!d[k]) { 
		d[k] = fib(k - 1) + fib(k - 2);
		return d[k];
	}
	else return d[k];
}

int main(){
	cin >> n;
	d[0] = 1; d[1] = 1;
	cout << fib(n) << endl;
}

C++: //#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second
#define mp make_pair
 
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1ll << 60;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

ll Fib[45];

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

  return 0;
}

C++: // -*- coding: utf-8 -*-
// Last-Updated : <2014/06/20 08:34:56 by samui>

#include <algorithm>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <bitset>

#define MP(a, b) std::make_pair(a, b)
#define X first
#define Y second
#define rep(i,n) for(int (i) = 0; (i) < (int)(n); ++(i))
#define rer(i,l,n) for(int (i) = l; (i) <= (int)(n); ++(i))
#define reu(i,l,n) for(int (i) = l; (i) < (int)(n); ++(i))
template<typename T,typename U> inline void amin(T &x,U y){ if(y<x) x = y;}
template<typename T,typename U> inline void amax(T &x,U y){ if(x<y) x = y;}
template<typename TYPE,std::size_t SIZE>
std::size_t len(const TYPE (&array)[SIZE]){return SIZE;}

// 幾何ライブ
typedef long double LD;
const LD INF = 1e100;
const LD EPS = 1e-8;
const LD PI = acos(-1);
typedef std::pair<LD,LD> PLD;
typedef std::vector<std::pair<LD,LD>> VPLD2;

class Point{
public:
  LD x,y;
  Point(LD x = 0,LD y = 0): x(x),y(y){ };
  Point operator + (Point p) {return Point(x+p.x,y+p.y);};
  Point operator - (Point p) {return Point(x-p.x,y-p.y);};
  Point operator * (LD a) {return Point(x*a,y*a);};
  Point operator / (LD a) {return Point(x/a,y/a);};
  LD abs(){return std::sqrt(x*x+y*y);};
  Point unit(){LD u = abs();return Point(x,y)/u; };
};
typedef Point Vector2D;
LD dotProduct(const Vector2D a,const Vector2D b){
  return a.x*b.x+a.y*b.y;
}
LD crossProduct(const Vector2D a, const Vector2D b){return a.x*b.y-a.y*b.x;}
LD angle(Vector2D a,Vector2D b){
  return acos(dotProduct(a,b)/(a.abs()*b.abs()));
}
LD norm(Vector2D a){return a.x*a.x+a.y*a.y;}
Point projection(Point a1,Point a2,Point a3){
  // 点a3にたいする線分a1-a2上への射影をもとめる。
  LD d = dotProduct(a3-a1,a2-a1)/norm(a2-a1);
  return (a1+(a2-a1)*d);
}
Point reflection(Point a1,Point a2,Point a3){
  return (a3+(projection(a1,a2,a3)-a3)*2);
}
int ccw(Point a1,Point a2,Point a3){
  Vector2D a = a2-a1;
  Vector2D b = a3-a1;
  if(crossProduct(a,b) > EPS) return 1; // a1,a2,a3が反時計まわり
  if(crossProduct(a,b) < -EPS) return -1;//a1,a2,a3が時計まわり
  if(dotProduct(a,b) < -EPS) return +2; //a3--a1--a2 で直線
  if(norm(a)< norm(b)) return -2; // a1--a2--a3 の順で直線
  return 0; // a1--a3--a2の順番
}


int main(int argc, char *argv[])
{
  int a[45];
  a[0] = 0;
  a[1] = 1;
  reu(i,2,45){
    a[i] = a[i-1]+a[i-2];
  }
  int t;
  std::cin>>t;
  std::cout<<a[t+1]<<std::endl;

  return 0;
}

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

int main() {
	int n,a=1,b=1;
	cin>>n;
	for(int i=0;i<n;i++){
		if(i%2==0){
			a=a+b;
		}
		else{
			b=b+a;
		}
	}
	
	if(n%2==0){
		cout<<a<<endl;
	}
	else{
		cout<<b<<endl;
	}
	
	return 0;
}

C++: #include<cstdio>
int F[46];
int fib(int flag){
	if(flag<2){
		return 1;
	}else if(F[flag]){
		return F[flag];
	}else{
		return F[flag]=fib(flag-1)+fib(flag-2);
	}
}
int main(){
	int num;
	scanf("%d", &num);
	printf("%d\n", fib(num));
	return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever while (true)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
using namespace std;

template<typename Integral = int> Integral fibonacci(const int &n) {
  static std::vector<Integral> dp(2, 1);
  int prev = dp.size();
  if (prev < n) {
    dp.resize(n + 1);
    loop(i, prev, dp.size()) dp[i] = dp[i - 1] + dp[i - 2];
  }
  return dp[n];
}

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