Go: package main

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

//util
var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

C++: //
//  main.cpp
//  ALDS1_10_A:FibonacciNumber
//
//  Created by Kang on 2020/8/12.
//  Copyright © 2020 Kang. All rights reserved.
//

#include <cstdio>
#include <cstring>
using namespace std;


int fiboFromTop(int n, int fibo[]) {
    if (fibo[n] != 0) {
        return fibo[n];
    }
    
    if (n == 0 || n == 1) {
        fibo[n] = 1;
        return 1;
    }
    else {
        fibo[n - 1] = fiboFromTop(n-1, fibo);
        fibo[n - 2] = fiboFromTop(n - 2, fibo);
        return fibo[n - 1] + fibo[n - 2];
    }
    
    
    return 0;
}

int fiboFromBottom(int n) {
    if (n == 0 || n == 1) {
        return 1;
    }
    int fibo[45];
    fibo[0] = 1;
    fibo[1] = 1;
    for (int i = 2; i <= n; i++) {
        fibo[i] = fibo[i-1] + fibo[i - 2];
    }
    return fibo[n];
}

int main(int argc, const char * argv[]) {
    // insert code here...
    int n;
    int fibonacci[45];
    memset(fibonacci, 0, 45 * sizeof(int));
    scanf("%d", &n);
    
    printf("%d\n", fiboFromTop(n, fibonacci));
    // printf("%d\n", fiboFromBottom(n));
    
    return 0;
}

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

int main()
{
    int i = 0;
    cin >> i;
    cout << fib(i) << endl;
}

C++: #include <bits/stdc++.h>

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

using namespace std;

// dp memory
const int MAX_N = 44;
int fib[MAX_N+1];

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

    // fib dynamic programming
    fib[0] = 1;fib[1] = 1;
    REP(i, 2, n+1){
        fib[i] = fib[i-1] + fib[i-2];
    }

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

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

long long F[100];

int fiv(long long N){
  if(N==0){
    return 1;
  }
  if(N==1){
    return 1;
  }
  if(F[N]!=0){
    return F[N];
  }
  return F[N]=fiv(N-1)+fiv(N-2);
}

  
int main(){
  long long N;
  cin>>N;
  for (int i=0;i<100;i++){
    F[i]=0;
  }
  cout<<setprecision(20)<<fiv(N)<<endl;
  return 0;
 }

C++: #include<cstdio>
#define rep(i,a) for(int i=0;i<(a);++i)

const int MAX_N = 44;

int n;
int fib[MAX_N+1];

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

    fib[0] = 1, fib[1] = 1;

    rep( i, n-1 )
        fib[i+2] = fib[i] + fib[i+1];

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

    return 0;
}

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

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

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

    cout << f[n] << endl;

    return 0;
}

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

int main(int argc, char const *argv[])
{
  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;

  return 0;
}

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

int main(int argc, char const *argv[])
{
    int a, *Fibonacci;
    cin >> a;
    Fibonacci = (int *)malloc((a+1) * sizeof(int));
    Fibonacci[0] = Fibonacci[1] = 1;
    for(int i=2; i<=a; ++i) {
        Fibonacci[i] = Fibonacci[i-1] + Fibonacci[i-2];
    }
    cout << Fibonacci[a] << endl;
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int fibo(int n){
    if(n < 2) return 1;
    return fibo(n-1)+fibo(n-2);
}

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

C++: #include <iostream>
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;
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n; cin>>n;
	int r[] = {1,1,2};
	if( n<=2 ){
		cout<<r[n]<<endl;
		return 0;
	}
	while( n>0 ){
		int tmp = r[1] + r[2];
		r[0] = r[1]; r[1] = r[2]; r[2] = tmp;
		n = n-1;
	}
	cout<<r[0]<<endl;
	return 0;
}

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

int main(int argc, char *argv[])
{
    int n;
    int fib[MAX] = {0};
    fib[0] = 1;
    fib[1] = 1;
    scanf("%d", &n);
    if (n < 2)
    {
        printf("%d\n", 1);
        return 0;
    }

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

C++: #include <bits/stdc++.h>

#define REP(i ,n) for(int i=0 ;i < n; i++)
#define REPB(i ,n) for(int i=n; i >= 0; i--)
#define FOR(i ,m ,n) for(int i=m; i < n; i++)
#define FORB(i, m, n) for(int i=m; i>= m; i--)
#define ll long long
#define pb push_back
#define popb pop_back
using namespace std;
vector<int> f;
int makeFib(int k){
    f.pb(1);
    f.pb(1);
    if(k >= 2){
    FOR(i,2,(k + 1)){
        f.pb(f[i - 2] + f[i - 1]);
      }
    }
      return f[k];
  }
int main(){
  int n;
  cin >> n;

  cout << makeFib(n) << endl;
}

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

int dp[50];

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

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

signed 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;
  return 0;
}

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

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

C++: /*
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=jp
*/
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(s,e) for(int i=s;i<e;i++)
ll A[44];
ll Fibo(int n){
  if(n==0 || n==1) return 1;
  if(A[n]!=0) return A[n];
  A[n-1]=Fibo(n-1);
  return A[n-1]+A[n-2];
}
int main(){
  int n;
  cin>>n;
  A[0]=A[1]=1;
  cout<<Fibo(n)<<"\n";
}

C++: #include <iostream>

using namespace std;

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

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

int fibo(int x) {
  int a;
  if ( x == 0 ) return 1;
  if ( x == 1 ) return 1;
  a = fibo(x-1) + fibo(x-2);
  return a;
}

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;
}