Go: package main

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

//util
var sc = bufio.NewScanner(os.Stdin)

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   for(int i=0;i<(n);++i)
#define SORT(c)    sort((c).begin(),(c).end())
#define CLR(a)     memset((&a), 0 ,sizeof(a))//clear memory
#define dump(x)    cerr << #x << " = " << (x) << endl;//debug
#define debug(x)   cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define EPS        1e-10//sample:if((double)>=(double)+EPS)
//cin,cout release
//std::cin.tie(0);
//ios::sync_with_stdio(false);

using namespace std;
unsigned long long int a[100000]={};
unsigned long long int fib(long long int n){
  if(a[n]!=0)return a[n];
  if(n==0)return 1;
  if(n==1)return 1;
  return a[n]=fib(n-1)+fib(n-2);
}


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

C++: 
//DP-1

#include<iostream>
#include<stdio.h>


using namespace std;


int main()
{
    int i,n;
    //メモ化のための配列
    int dp[50];
    scanf("%d",&n);
    dp[0]=1;
    dp[1]=1;

    for(i=2;i<=n;i++)
    {
        dp[i]=dp[i-1]+dp[i-2];
    }
    printf("%d\n",dp[n]);

}

C++: #include<stdio.h>

int d[50];

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

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

  return 0;
}

C++: #include"iostream"
using namespace std;
int n;
int main()
{
	cin >> n; 
	if (n == 1 || n == 0){
		cout << 1 << endl; return 0;
	}
	long long a=1, b=1,c;
	for (int i = 1; i < n; i++)
	{
		c = a + b;
		a = b;
		b = c;
	}
	cout << c << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;i<(n);(i)++)
using namespace std;
 
int main(){
  long long int N;
  cin>>N;
 long long int M[N+10];
  M[0]=1;
  M[1]=1;
  for(int i=0;i<N-1;i++){
    M[i+2]=M[i]+M[i+1];
  }
  cout<< M[N]<<endl;
}

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

using namespace std;

// conversion
//------------------------------------------
inline int toInt(string s) {
    int v;
    istringstream sin(s);
    sin >> v;
    return v;
}
template <class T>
inline string toString(T x) {
    ostringstream sout;
    sout << x;
    return sout.str();
}

// math
//-------------------------------------------
template <class T>
inline T sqr(T x) {
    return x * x;
}

// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) \
    for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPI(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)

// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF_INT = 2147483647;
const LL INF_LL = 9223372036854775807;

// clear memory
//--------------------------------------------
#define CLR(a) memset((a), 0, sizeof(a))

// vector
//--------------------------------------------
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}

// pair
//--------------------------------------------
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}

// vector
//--------------------------------------------
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}

// list
//--------------------------------------------
template <typename T>
ostream &operator<<(ostream &os, const list<T> &lst) {
    os << "{";
    REPI(itr, lst) {
        os << *itr;
        itr++;
        if (itr != lst.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}

// map
//--------------------------------------------
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    REPI(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}

// set
//--------------------------------------------
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    REPI(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}

// dump
//--------------------------------------------
#define DUMPOUT cerr

void dump_func() { DUMPOUT << endl; }
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef DEBUG_
#define DEB
#define dump(...)                                                       \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                     \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" \
            << endl                                                     \
            << "    ",                                                  \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif

int n;
int f[45];

int main(void) {
    cin >> n;
    f[0] = f[1] = 1;
    FOR(i, 2, n + 1) f[i] = f[i - 1] + f[i - 2];
    cout << f[n] << endl;
    return 0;
}

C++: //============================================================================
// Name        : Fibonacci.cpp
// Author      : Ken
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <vector>
using namespace std;

int calcFibonacci(int n){
	vector<int> fib(n+1);
	if(n == 0){
		return 1;
	}else if(n == 1){
		return 1;
	}else{
		fib.at(0) = 1;
		fib.at(1) = 1;
		for(int i=2; i<n+1; i++){
			fib.at(i) = fib.at(i-1) + fib.at(i-2);
		}
		return fib.at(n);
	}
}

int main() {
	int n;
	cin >> n;
	cout << calcFibonacci(n) << "\n";

	return 0;
}

C++: a

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

using namespace std;

int main() {

    vector<ll> dp;
    dp.push_back(1);
    dp.push_back(1);
    ll n;
    cin >> n;
    for(ll i=0;i<n;i++) {
        dp.push_back(dp[i]+dp[i+1]);
    }
    cout << dp[n] << endl;;
}