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;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll tmp1,tmp2,tmp3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}
vector<ll> fib(100,-1);
ll calc_fib(ll k){
  if(fib[k] != -1){
    return fib[k];
  }
  fib[k] = calc_fib(k-1) + calc_fib(k-2);
  return fib[k];
}
int main(){
  fib[0] = 1;
  fib[1] = 1;
  ll n;
  cin >> n;
  rep(i,n){
    calc_fib(i);
  }
  cout << calc_fib(n) << endl;
}

C++: #include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
int main(){
  long long int i,n,dp[50];
  scanf("%lld\n",&n);
  dp[0]=1,dp[1]=1;
  for(i=2;i<=n;i++){
    dp[i]=dp[i-1]+dp[i-2];
  }
  printf("%lld\n",dp[n]);
  return 0;
}

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

#define MAX 45

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

int main()
{
    int C;

    cin >> C;

    //cout << fibonacci(C) << endl;

    int F[MAX];

    F[0] = 1;
    F[1] = 1;

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

    cout << F[C] << endl;

    return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <cstring>
 
typedef long long ll;

#define rep(i,n) for(ll i = 0; i < n; i++)
 
using namespace std;
 
const ll INF = ll(1e18)+1;
const double PI=3.14159265358979323846;

int dp[50];

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

C++: #include <iostream>
#include <vector>
using namespace std;
int fib(int x, vector<int>& f)
{
if (f[x-1] == -1) f[x-1] = fib(x-1, f);
if (f[x-2] == -1) f[x-2] = fib(x-2, f);
return f[x-1] + f[x-2];
}

int main()
{
int x; cin >> x;
vector<int> f(x+1, -1); f[0] = f[1] = 1;
cout << fib(x, f) << endl;
return 0;
}

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

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

    int first = 1;
    int second = 1;
    
    for (int i = 2; i < input; ++i) {
        int third = first + second;
        first = second;
        second = third;
    }
    cout << second << "\n";
    
    return 0;
}

C++: class RecursiveFibonacci:public Fibonacci{
public:
	virtual int calc(int x);
};

int RecursiveFibonacci::calc(int x){
	if(x == 0){
		return 0;
	}else if(x == 1){
		return 1;
	}else{
		return calc(x - 1) + calc(x - 2);
	}
}

C++: using namespace std;

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

    int first = 1;
    int second = 1;
    
    for (int i = 2; i < input; ++i) {
        int third = first + second;
        first = second;
        second = thid;
    }
    cout << second;
    
    return 0;
}

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

int fib(int n);

int main(){
	int n;
	cin >> n;
	cout << fib(n) << endl;
}
	
int fib(int n){
	int num1 = 1,num2 = 1;
	int temp = 0;
	if(n == 0 || n == 1) return 1;
	
	for (int i = 1;i < n;i++){
		temp = num2;
		num2 = num1 + num2;
		num1 = temp;
	}
		return num2;
}

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

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

	return 0;

}

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

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

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

#define NIL -1

int dp[100];

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

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

C++: fibonacci :: Int -> Int
fibonacci = fibo (1, 1) 2
    where
      fibo :: (Int, Int) -> Int -> Int -> Int
      fibo (pp, prev) pos n
          | n < 2 = 1
          | pos >= n = pp + prev
          | otherwise = fibo (prev, pp+prev) (pos+1) n

main :: IO ()
main = do
  n <- readLn
  putStrLn $ show $ fibonacci n

C++: #include <stdio.h>

int dp[50];

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

int main()
{
    int n, i;
    for (i = 0; i < 50; i++)
        dp[i] = -1;

    scanf("%d", &n);
    printf("%d\n", fib(n));

    return 0;
}