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 <iostream>
using namespace std;
int TwicePreviousValue = 1;
int PreviousValue = 1;

int Fibonacci(const int& n)
{
	if(n == 0) return TwicePreviousValue;
	if(n == 1) return PreviousValue;
	int CurrentValue = TwicePreviousValue + PreviousValue;
	for(int i = 2; i < n; i++){
		int TemporaryValue = PreviousValue;
		CurrentValue  += PreviousValue;
		PreviousValue += TwicePreviousValue;
		TwicePreviousValue = TemporaryValue;
	}
	return CurrentValue;
}
 
int main()
{
	int n;
	cin >> n;
	cout << Fibonacci(n) << endl;
	return 0;
}

C++: #include<stdio.h>

int main(){

  int num;

    scanf("%d",&num);


  printf("%d\n",num);
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
const int maxn=50;
int n;
int a[maxn];
int fib(int n)
{
    a[0]=1;
    a[1]=1;
    for(int i=2;i<=n;i++) a[i]=a[i-2]+a[i-1];
    return a[n];
}
int main()
{
//    freopen("in.txt","r",stdin);
    scanf("%d",&n);
    printf("%d\n",fib(n));

    return 0;
}

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

int F[44];

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(){
	int n;
	cin>>n;
	for(int i=0;i<=n;i++){
		F[i]=-1;
	}
	cout<<fib(n)<<endl;
	
	return 0;
}

C++: #include <cstdio>
using namespace std;
int F[45]={0};
int FIB(int u){
  if(u==0||u==1){
    F[u]=1;
    return F[u];
  } else{
    F[u]=FIB(u-1)+FIB(u-2);
    return F[u];
  }
}
int main(){
  int n;
  scanf("%d",&n);
  printf("%d\n",FIB(n));
  return 0;
}

C++: #include <iostream>

using namespace std;

int fib(int n);

int main() {
  int n;

  //入力
  cin >> n;

  // 出力
  cout << fib(n) << endl;

  return 0;
}

int fib(int n){
  /*　演習　*/
  if(n == 0) return 1;
  else if(n == 1) return 1;
  else return fib(n-1) + fib(n-2);
}

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

typedef long long ll;

ll table[45];
bool flg[45];

ll fib(int n){
    if(flg[n])return table[n];
    else{
        flg[n]=true;
        return table[n]=fib(n-1)+fib(n-2);
    }
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    table[0]=table[1]=1;
    flg[0]=flg[1]=true;
    int n;
    cin >> n;
    cout << fib(n) << endl;
}

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

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF = 1e9;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

int main()
{
    ios::sync_with_stdio(false);

    int dp[50] = {};
    dp[0] = dp[1] = 1;
    REP(i, 2, 50) dp[i] = dp[i-1] + dp[i-2];

    int N;
    cin >> N;
    cout << dp[N] << endl;

}

C++: #include <bits/stdc++.h>
#define FOR(i, l, r) for(ll i = l; i < r; i++)
#define rep(i, N) FOR(i, 0, N)
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll MOD = round(1e9+7);

int main() {
    int n; cin >> n;
    vi fib(45, 1);
    FOR(i,2,45){
        fib[i] = fib[i-1] + fib[i-2];
    }

    cout << fib[n] << endl;
    return 0;
}

C++: #include<stdio.h>

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

int main()
{
  int n;

  scanf("%d",&n);

  //n = fib(n);

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

  return 0;
}

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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

int fib[100];

ll f(int n) {
   if (n == 1 || n == 2) return 1;
   if (fib[n]) return fib[n];
   return fib[n] = f(n-1) + f(n-2);
}

ll f2(int n) {
   if (n == 1 || n == 2) return 1;
   return f2(n-1) + f2(n-2);
}

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

   return 0;
}

C++: 

def main():
    n = int(input())
    dp = [0] * 100
    dp[0] = 1
    dp[1] = 1
    for i in range(2, len(dp)):
        dp[i] = dp[i - 1] + dp[i - 2]
    print(dp[n])


if __name__ == '__main__':
    main()

C++: #include <iostream>
int F[100]; // ???????????????
int main() 
{
int n;
F[0] = 1;
F[1] = 1;
for (int i=2; i<45; ++i) 
{ // ???????????????
F[i] = F[i-2]+F[i-1];
}
cin>>n;
cout<<F[n];
}