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<cstdio>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<vector>

using namespace std;

#define MAX_N 44
// 無効な値の定義
const int INV = -1;

// フィボナッチ数列を保持する配列
int fib[MAX_N + 1];

int Fibonacci(int n);

int main(void)
{

    int n;

    cin >> n;

    for(int i = 0; i <= MAX_N; i++)
    {
        fib[i] = INV;
    }

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

    // フィボナッチ数列の表示
    printf("%d\n", Fibonacci(n));

    return 0;
}

// フィボナッチ数列を算出する関数
int Fibonacci(int n)
{
    if( n <= 1)
    {
        return 1;
    }

    if( fib[n] != INV )
    {
        // 既に計算されている時は, 結果を返す
        return fib[n];
    }

    return Fibonacci(n - 1) + Fibonacci(n - 2);
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
typedef long double ld;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1000000009;

ll fib[50];

void solve(){

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

}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}

C++: #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
ll func(int at,V &dp){
    if(dp[at]==-1){
        dp[at]=func(at-1,dp)+func(at-2,dp);
    }
    return dp[at];
}
int main(){
    int n;
    cin >> n;
    vector<ll>dp(n+3,-1);  
    dp[0]=1LL;
    dp[1]=1LL;

    cout << func(n, dp)<< endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
long long a[1005];
int main(){
//	freopen("a.txt","r",stdin);
	a[0]=a[1]=1;
	for(int i=2;i<=44;i++)
		a[i]=a[i-2]+a[i-1];
	int n;cin>>n;cout<<a[n]<<endl;
	return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
#define ll long long 

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

    vector<ll> 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>
#define PI 3.14159265359
#define NIL (-1)
using namespace std;
const int64_t MOD = 1e9 + 7;

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

	vector<int> v(50);
	for (int i = 0; i < 50; i++) {
		if (i <= 1) v.at(i) = 1;
		else v.at(i) = v.at(i - 1) + v.at(i - 2);
	}

	cout << v.at(n) << endl;
}

C++: #include <stdlib.h>
#include <stdio.h>

int fib(int n){
int i;
int a[44];
a[0]=a[1]=1;
for(i=2;i<=n;i++){
a[i]=a[i-1]+a[i-2];
   }
return a[n];
}

int main(){

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

return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <stack>
#include <vector>
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstring>
#include <queue>

using namespace std;

const double PI = 3.14159265358979;


const vector<int>* fibon_seq(int size) {

	static vector<int> elems;
	for (int i = elems.size(); i <= size; i++) {
		if (i == 0 || i == 1)
			elems.push_back(1);
		else
			elems.push_back(elems[i - 1] + elems[i - 2]);
	}
	return &elems;
}




int main() {

	int n; cin >> n;
	vector<int>  res = *fibon_seq(n);

	cout << res[n] << endl;

	return 0;
}

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

int N;
int memo[50];

int fibo(int n) {
    if (n <= 1) return 1;
    if (memo[n] == -1) memo[n] = fibo(n - 1) + fibo(n - 2);
    return memo[n];
}

int main(void) {

    cin >> N;

    for (int i = 0; i < 50; ++i) memo[i] = -1;

    cout << fibo(N) << endl;

    return 0;
}

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

typedef long long ll;
typedef pair<ll, ll> P;

const ll mod =  1000000007;  //出力は (ans % mod + mod) % mod  (負の剰余を正にする)
const int inf = 1e9;
const long long INF = 1LL << 60;   // INF = 11

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

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

int fib[45];
int n;

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

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

  std::cout << fib[n] << std::endl;

  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007

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

int n;
int a[50];


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

  return 0;
}

C++: #include<cstdio>
#define MAX 45
int F[MAX];

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

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

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

	return 0;
}

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