Go: package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n, err := nextInt(sc)
	if err != nil {
		panic(err)
	}
	fmt.Println(fibonacci(n, make(map[int]int)))
}

func fibonacci(x int, memo map[int]int) int {
	if x == 0 || x == 1 {
		return 1
	}
	if y, ok := memo[x]; ok {
		return y
	}
	z := fibonacci(x-1, memo) + fibonacci(x-2, memo)
	memo[x] = z
	return z
}

func nextInt(sc *bufio.Scanner) (int, error) {
	sc.Scan()
	return strconv.Atoi(sc.Text())
}

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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aut(r,v) __typeof(v) r = (v)
#define each(it,o) for(aut(it,(o).begin()); it!=(o).end(); ++it)
#define reach(it,o) for(aut(it,(o).rbegin()); it!=(o).rend(); ++it)
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T1, typename T2> ostream& operator<<(ostream& o, const pair<T1, T2>& p)
{return o<<"("<<p.first<<", "<<p.second<<")";}
template<typename T>string join(const vector<T>&v, string del=", ")
{stringstream s;rep(i,v.size())s<<del<<v[i];return s.str().substr(del.size());}
template<typename T>ostream& operator<<(ostream& o, const vector<T>&v)
{if(v.size())o<<"["<<join(v)<<"]";return o;}
template<typename T>ostream& operator<<(ostream& o, const vector<vector<T> >&vv)
{int l=vv.size();if(l){o<<endl;rep(i,l){o<<(i==0?"[ ":",\n  ")<<vv[i]<<(i==l-1?" ]":"");}}return o;}
template<typename T>ostream& operator<<(ostream& o, const set<T>& st)
{vector<T> v(st.begin(),st.end());o<<"{ "<<join(v)<<" }";return o;}
template<typename T1, typename T2>ostream& operator<<(ostream& o, const map<T1, T2>& m)
{each(p,m){o<<(p==m.begin()?"{ ":",\n  ")<<*p<<(p==--m.end()?" }":"");}return o;}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const ll INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");

    int n; cin >> n;
    vi dp(n+1);
    dp[0] = dp[1] = 1;
    REP(i,2,n+1) dp[i] = dp[i-1] + dp[i-2];
    cout << dp[n] << endl;
    return 0;
}

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

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

    std::vector<int> vec(n + 1);
    vec.at(0) = 1;
    vec.at(1) = 1;
    for(int i = 2; i <= n; ++i){
        vec.at(i) = vec.at(i - 1) + vec.at(i - 2);
    }

    std::cout << vec.at(n) << std::endl;

    return 0; 
}

C++: //Fibonacci Number
#include <iostream>

using namespace std;

const int NIL = -1;

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

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

    cout << fibonacci(fib, n) << endl;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n;
    int a=0,b=1;
    int c;
    cin>>n;
    for (int i=0;i<=n;i++) {
        c=a+b;
        a=b;
        b=c;
    }
    cout<<a<<endl;
}

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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

// n回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;  // 2次元配列
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> PII;

template<typename T>
using vec = vector<T>;
template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld Pi = std::acos(-1.0L);
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;


/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    int _StartTime_ = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    // cout << fixed << setprecision(15);

    int n; cin >> n;
    vll fib(n+1);
    fib[0] = fib[1] = 1;
    for(int i = 2; i <= n; ++i) {
        fib[i] = fib[i-1] + fib[i-2];
    }
    cout << fib[n] << '\n';
    // printf("ExcutionTime: %d /ms\n",1000*(int)((clock()-_StartTime_)/CLOCKS_PER_SEC));
}

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

int main()
{
    int n;
    cin >> n;
    long fib[3] = {1, 0, 0};
    for (int i = 0; i <= n; ++i) {
        fib[2] = fib[1] + fib[0];
        fib[0] = fib[1];
        fib[1] = fib[2];
    }
    cout << fib[2] << endl;
    return 0;
}

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

int main() {
  int x, y;
  int F[50];
  F[0] = F[1] = 1;
  for ( i = 2; i < 50; i++ ) F[i] = F[i-1] + F[i-2];

  cin >> x;
  cout << F[x] << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int F[114]={};
int fib(int n){
    if(n == 0 || n == 1) return F[n] = 1;
    else if(F[n] != 0) return F[n];
    else {
        return F[n] = fib(n-1) + fib(n-2);
    }
}

int main() {
    ios::sync_with_stdio(false);
    int n;
    cin >>n;
    fib(n);
    cout << F[n] << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for(int i=0; i<(a); i++)
typedef long long ll;

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

  return 0;
}

C++: #include <iostream>

using namespace std;


int F[45];

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

  int input;
  cin >> input;
  cout << F[input]<< endl;
}

C++: #include<stdio.h>
#define N 100

int F[N];

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

int main(){
    int n;
    scanf("%d",&n);
    printf("%d\n",fibonacci(n));
    return 0;
}

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

int main()
{

	int n;
	cin >> n;

	vector<int64_t> fib(n+1);
	fib[0]=1;
	fib[1]=1;

	for (int i=2;i<=n;++i)
	{
		fib[i]=fib[i-1]+fib[i-2];
	}
	cout << fib[n] << endl;
}

C++: #include<iostream>
using namespace std;
int fib(int n)
{
    int F[50];
    if(n<=1) return 1;
    for(i = 2 ; i < =n; i++)
    {
        F[i] = F[i-1] + F[i-2];
    }
    return F[n];
}

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

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

int n, A[44];

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

int main(){
    cin >> n;
    fibo();
    cout << A[n] << endl;
    return 0;
}