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 <bits/stdc++.h>
using namespace std;
int main() {
  int fib[100];
  fib[0] = 1;
  fib[1] = 1;
  for(int i = 2;i < 50;i++)fib[i] = fib[i-1] + fib[i-2];
  int n;
  cin >> n;
  cout << fib[n] << endl;
}

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

const int maxn = 50;

int n;
int a[maxn];

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

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

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

template <typename T>
T fib(int n){
    std::vector<T> fibs{1, 1}; // using C++11
    for (int i = 2; i <= n; i++){
        fibs.push_back(fibs[i - 2] + fibs[i - 1]);
    }
    return fibs[n];
}

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

C++: //By Vlgd
#include<bits/stdc++.h>
using namespace std;
int F[45]={0};
int f(int n){
	if (n==1||n==0) return F[n]=1;
	if (F[n]) return F[n];
	else return F[n]=f(n-1)+f(n-2);
}
main(){
	int n;scanf("%d",&n);
	printf("%d\n",f(n));
}

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

using namespace std;

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

C++: #include<stdio.h>
#define MAX 50
int dp[MAX];

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

int main()
{
	for (int i = 0; i < MAX; i++)
	{
		dp[i] = -1;
	}

	int n;
	scanf("%d", &n);

	printf("%d\n", fibonacci(n));
}

C++: #include <iostream>
using namespace std;
 
int main() {
	void fibonacci_1(const int count , int data[]) {
	data[0] = 1;
	if(count == 1) return;
	data[1] = 1;
 
	for( int i = 2; i < count ; i++) {
		data[i] = data[i-1]+data[i-2];
	}
}
	return 0;

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

int fibonacci(int n);

int F[45];

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

int fibonacci(int n){
	F[0] = F[1] = 1;
	for(int i=2;i<=n;i++)
		F[i] = F[i-1]+F[i-2];
	return F[n];
}

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

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

using namespace std;

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

C++: #include <iostream>
#define MAX 50
using namespace std;
typedef long long ll;

ll dp[MAX];

int Fibonacci(int n) {
    if(dp[n] != 0) return dp[n];
    if(n==0 || n == 1) return 1;
    ll tmp = Fibonacci(n-1) + Fibonacci(n-2);
    dp[n] = tmp;
    return tmp;
}

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

C++: #include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>

using namespace std;

int main()
{
    int fib[45] = {};
    fib[0] = fib[1] = 1;

    int n;
    cin >> n;
    if (n < 2) {
        cout << fib[n] << endl;
    } else {
        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>
using namespace std;

int main() {
	int n;
	cin >> n;
	int F[50];
	F[0] = F[1] = 1;
	for (int i = 2; i <= n; i++) 
		F[i] = F[i - 1] + F[i - 2];
	cout << F[n] << endl;
}

C++: #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>
#include <functional>
#include <map>
#include <set>
#include <cmath>
#include <string>
#define SIZE 200005
#define INF 1000000005LL

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int n;
ll K;

int main()
{
	scanf("%d",&n);
	int dp[50];
	for(int i=0;i<=n;i++){
		if(i==0||i==1){
			dp[i]=1;continue;
		}
		dp[i] = dp[i-1]+dp[i-2];
	}
	printf("%d\n",dp[n]);
	return 0;
}

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

int memo[111]={0};

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

int main(){
  int a;

  scanf(" %d",&a);

  fib(a);

  cout << memo[a] << endl;

  return 0;

}