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++: /*
 * a.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 44;

/* typedef */

/* global variables */

int fs[MAX_N + 1];

/* subroutines */

/* main */

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

  fs[0] = fs[1] = 1;

  for (int i = 2; i <= n; i++)
    fs[i] = fs[i - 1] + fs[i - 2];

  printf("%d\n", fs[n]);
  return 0;
}

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

int main()
{
	int n,x1=1,x2=1,tmp=0;
	cin >> n;
	
	if(n==0||n==1) cout << "1";
	else{
		for(;n>2;n--){
			tmp=x1+x2;
			x1=x2;
			x2=tmp;
		}
		cout << x1 + x2;
	}
	
	return 0;
	
}

C++: #include <cstdio>
#include <algorithm>
#include <utility>

using namespace std;

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

    int fib[2]={1, 1};
    for (size_t i=0; i<n; ++i)
        swap(fib[0]+=fib[1], fib[1]);

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

C++: #include <iostream>

using namespace std;

#define MAX 45

int FibValue[MAX];

long long FibonacciNumber(int n)
{
	if (FibValue[n] != -1) return FibValue[n];

	if (n == 0 || n == 1)
	{
		FibValue[n] = 1;
		return FibValue[n];
	}

	FibValue[n] = FibonacciNumber(n - 1) + FibonacciNumber(n - 2);
	return FibValue[n];
}

int main()
{
	for (int i = 0; i < MAX; ++i)
		FibValue[i] = -1;
	int n; cin >> n;

	cout << FibonacciNumber(n) << endl;

	return 0;
}

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

int main()
{
	int F[100];
	F[0]=1;
	F[1]=1;
	for(int i=2;i<45;++i){
		F[i]=F[i-2]+F[i-1];
	}

	int n;
	cin>>n;
	cout<<F[n]<<endl;
	return 0;
}

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

int main() {
  int n; cin >> n;
  int f[45]; 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; 
}

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

long long f[50] = {};
long long fib(long long n) {
  if (f[n] > 0) return f[n];
  if (f[n-1] == 0){
    f[n-1] = fib(n-1);
  }
  if (f[n-2] == 0){
    f[n-2] = fib(n-2);
  }
  f[n] = f[n-1] + f[n-2];
  return f[n];
}

void Main()
{
  f[0] = 1; f[1] = 1;
  long long n; cin >> n;
  cout << fib(n) << endl;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  Main();
  return 0;
}

C++: #pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 1<<30
#define MOD 1000000007
#define mod 1000000007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_time=clock();
    //-------------------------------
    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;
    //-------------------------------  
    //ll end_time=clock();cout<<"time="<<end_time-begin_time<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {

    int n;
    cin >> n;

    vector<int> dp(n+1);

    dp[0] = 1;
    dp[1] = 1;

    for ( int i = 0; i <= n - 2; ++i ) {
        dp[i+2] = dp[i+1]+dp[i];
    }

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

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

int f[46]={0};

int fib(int n){
    f[0] = 1;
    f[1] = 1;
    for(int i=2; i<46; i++)    f[i] = f[i-1]+f[i-2];

    return f[n];
}

int main(void){
    int x;
    cin >> x;
    cout << fib(x) << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int fib(int n) 
{
	if (n >= 0) {
		if (n <= 1) return 1;
		return fib(n - 1) + fib(n - 2);
	}
}
int main(void)
{
	int n;
	scanf_s("%d", &n);
	printf("%d", fib(n));
}

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

int fib(int dp[50],int n){
    if(n<=1)return dp[n]=1;
    if(dp[n]!=-1)return dp[n];
    return dp[n]=fib(dp,n-1)+fib(dp,n-2);
}

int main(){
    int n;
    int dp[50];
    memset(dp,-1,sizeof(dp));

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

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

int fib(int n){

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

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

  cout << fib(n) << endl;; 

  return 0;

}