Go: package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

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

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

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


int main(){
  int fib[N+1];
  int n;
  cin >> n;
  fib[0]=fib[1]=1;
  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;
 
using ll = long long;
using ld = long double;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int n;
    cin >> n;

    map<ll, ll> memo;
    memo[0] = 1;
    memo[1] = 1;
    function<ll(ll)> fib = [&](ll m) {
        if (memo.count(m)) return memo[m];
        return memo[m] = fib(m - 1) + fib(m - 2);
    };
    cout << fib(n) << endl;
}

C++: #include <iostream>
using namespace std;
int dp[45];

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

C++: #include <stdio.h>

 int F[44];
 int fib(int);

 int main(){

   int n;

   scanf("%d",&n);

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

   return 0;

 }

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-2)+fib(n-1);

}

C++: #include<bits/stdc++.h>
using namespace std;
using ll =long long;
ll dp[50];
ll fib(ll n){
    if(n==0)return dp[0]=1;
    else if(n==1)return dp[1]=1;
    else if(dp[n]!=-1)return dp[n];
    return dp[n]=fib(n-1)+fib(n-2);
}
int main(){
    ll n;
    cin>>n;
    for(int i=0;i<50;i++)dp[i]=-1;
    cout<<fib(n)<<endl;
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()


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

C++: #include<iostream>
using namespace std;
int main() {
	int fib[50];
	fib[0] = 1;
	fib[1] = 1;
	int n; cin >> n;
	for (int i = 2; i < n + 1; i++){
		fib[i] = fib[i - 1] + fib[i - 2];
	}
	cout << fib[n] << endl;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <cstdio>

int main()
{
    int N;
    int i = 2;

    int now;
    int l1 = 1;
    int l2 = 1;

    scanf("%d", &N);
    if(N < 2){
        printf("%d\n", 1);
        return 0;
    }

    for (;;)
    {
        now = l1 + l2;
        if(i == N){ break; }
        l1 = l2;
        l2 = now;
        i++;
    }

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

C++: 

#include<stdio.h>
#define N 45
 
int main(){
int i,n,F[N];
F[0]=F[1]=1;

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

C++: 
f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))

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