Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
int main() {
	int n; cin >> n;
	vi v(50, 0);
	v[0] = v[1] = 1;
	rep(i, 2, n + 1) {
		v[i] = v[i - 2] + v[i - 1];
	}
	P(v[n]);
	return 0;
}

C++: #include<iostream>
#include<string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <algorithm>
#include <cstdlib>
using namespace std;
int ctoi(char c) {
	switch (c) {
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default: return 0;
	}
}

int main() {
	int N;
	cin >> N;
	vector<int> F(50);
	F.at(0) = F.at(1) = 1;
	for (int i = 2; i <= N; i++) {
		F.at(i) = F.at(i - 1) + F.at(i - 2);
	}
	cout << F.at(N) << endl;
}

C++: #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for(ll i = m; i < (n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>; 
using vl = vector<ll>;
using vll = vector<vl>;
using pll = pair<ll, ll>;

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

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

C++: #include <iostream>
using namespace std;
 
int main() {
	int fib[45]={1,1},i;
for(i=2;i<=44;i++){
fib[i]=fib[i-1]+fib[i-2];
}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

  int n;

  int n1,n2,st;

  n1=1;
  n2=1;
  st=1;

  cin >>n;

  for(int i=1;i<=n;i++){
    st=n1+n1;
    n1=n2;
    n2=st;
  }
  cout <<st<<endl;

}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

int fib[46];

int main()
{
	memset (fib, 0, sizeof (fib ) );
	fib[0] = 1;
	fib[1] = 1;
	for (int i = 2; i < 46; i++ ){
		fib[i] = fib[i-1] + fib[i-2];
	} // end for

	ios_base::sync_with_stdio(0);
	int n; cin >> n;
	printf ("%d\n", fib[n] );
		
	return 0;
}

C++: #include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 1010101010101010;
const int INF = 1010101010;
const int dx[] = {-1,0,1,0,-1,-1,1,1};
const int dy[] = {0,-1,0,1,1,-1,1,-1};

int main(){
  int n; cin>>n;
  int dp[10101010];
  rep(i,10101010){
    if(i==0||i==1) dp[i]=1;
    else dp[i]=dp[i-1]+dp[i-2];
  }
  cout<<dp[n]<<endl;
}

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

int main()
{
    int n;
    scanf("%d", &n);
    vector<int> a(n + 1);
    a[0] = a[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        a[i] = a[i - 1] + a[i - 2];
    }
    printf("%d\n", a[n]);
}

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

#define MAX 50

int dp[MAX];

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

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

  cout << fib(n) << endl;

  return 0;
}

C++: #include <stdio.h>
int F[50];
int fib(int n) {
	if (n == 0 || n == 1) {
		return F[n]=1;
	}
	if (F[n] != -1) return F[n];
	return F[n]=fib(n - 1) + fib(n - 2);
}
int main(void) {
	int n,i=50;
	while (i--) F[i]=-1;
	scanf("%d", &n);
	printf("%d\n",fib(n));
	return 0;
}