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 <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int fib[100];
int main(){
	int n;
	cin>>n;
	fib[0]=1;
	fib[1]=1;
	//fib[2]=1;
	for(int i =2;i <= n;i++){
		fib[i]=fib[i-1]+fib[i-2];
	}
	cout <<fib[n]<<endl;
	return 0;
}

C++:                                         #include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                                #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;


int gcd(int a,int b){
	if(a<b) return gcd(b,a);
	if(b==0) return a;
	if(a%b==0) return b;
	return gcd(b,a%b);
}
map<int,int>ma;
           signed main(){
               int n;
 // cin>>n;
         int f[100];
           	f[0]=1;
           	f[1]=1;
           	for(int  i=2;i<50;i++)f[i]=f[i-1]+f[i-2];
           	int u;
           	cin>>u;
           	
           	cout<<f[u]<<endl;
           }

C++: #include <iostream>
#include <map>

int rec_fibonacci(int n, std::map<int, int>* m) {
  if (n == 0 || n == 1)
    return 1;
  if (m->find(n) == m->end())
    (*m)[n] = rec_fibonacci(n-1, m) + rec_fibonacci(n-2, m);
  return (*m)[n];
}

int fibonacci(int n) {
  std::map<int, int> m;
  return rec_fibonacci(n, &m);
}

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

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

using namespace std;
vector<int> fib(50);

int makefib(int n){
  if(n==0||n==1) return fib[n]=1;
  if(fib[n]!=-1) return fib[n];
  else return fib[n]=makefib(n-1)+makefib(n-2);
}
		  
int a;
int main(void){
  cin>>a;
  for (int i=0; i<50; i++) fib[i]=-1;
  cout<<makefib(a)<<endl;
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int,int>P;
int dp[100];
int fibo(int x){
	if(x==0||x==1){return dp[x]=1;}
	if(dp[x]!=0){return dp[x];}  
  	return dp[x]=fibo(x-1)+fibo(x-2);
  
}
 


int main() {
 rep(i,100){dp[i]=0;}
  int n; cin>>n;
	cout<<fibo(n)<<endl;
  
  
}

C++: #include<iostream>

using namespace std;

long fivo(long a){
  if (a==1 or a==2) return 1L;

  else 
    
    return fivo(a-1)+fivo(a-2);
}




int main(){
  long n,req;
  
  cin >>req;
  n=fivo(req+1);
  //  for(n=1;n<=20;n++){
  //cout<<fivo(n)<<endl;
  // }
  cout <<n<<endl;
  return 0;
}

C++: #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
bool pairCompareSecond(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.second < secondElof.second;
}
#define MAX_N 100100
#define MOD 998244353
// 四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
ll ans[100];
ll fib(ll x){
    if (ans[x]!=-1)return ans[x];
    ans[x]=fib(x-1)+fib(x-2);
    return ans[x];
}

int main(){
    fill(ans,ans+50,-1);
    ans[0]=1;
    ans[0]=1;
    ll n;
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}