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 <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  int dp[n+1];
  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++: #ifdef DEBUG
#include "../utils.cpp"
#endif
#include <bits/stdc++.h>
/*
Problem
 
Category
DP
 
URL:
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja

考察:


Date: 2020/04/18
*/
 

using namespace std;
using ll = int64_t;
#define int int64_t

 
/* ==== declarations ====== */
// functions
void solve();
void getInput();
 
// global variables
int n;
vector<int> dp;

/* ======================== */
int fib(int k) {
    if (dp[k] == 0) dp[k] = fib(k-1) + fib (k-2);
    return dp[k];
}

void getInput() {
    cin>>n;
    dp = vector<int>(n+1, 0);
    dp[0] = 1; dp[1] = 1;
}
 
 
void solve() {
    cout<<fib(n)<<endl;
}
 
 
 
signed main(){
    getInput();
    solve();
    return 0;
}

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

int main() {
  int a[45];
  a[0] = a[1] = 1;

  int n; cin >> n;

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

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    scanf("%d", &n);
    vector<long long> fib;
    fib.push_back(1);
    fib.push_back(1);
    for(int i = 2; i < 45; i++){
        long long val = fib.at(i - 1) + fib.at(i - 2);
        fib.push_back(val);
    }
    cout << fib.at(n) << endl;
}

C++: #include <iostream>

using namespace std;

int fib(int n);
int memo[45];
int main() {
    int n;

    //??\???
    cin >> n;

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

    return 0;
}

int fib(int n){
  /* ??????1 */
  if(n==0||n==1)    return 1;
  else if(memo[n]!=0){
    return memo[n];
  }else{
    return memo[n]=fib(n-1)+fib(n-2);
  }
}

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)

using namespace std;

const int mod=1e9+7;

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n;
    cin>>n;
    vi f(n+1);
    f[0]=f[1]=1;
    REP(i,2,n){
        f[i]=f[i-1]+f[i-2];
    }
    cout<<f[n]<<endl;
}

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

C++: #include <iostream>

using namespace std;

typedef long long signed int ll;

constexpr ll NIL = -20000000000;

ll dp[50];

ll fib(int n) {
    if(n < 3) return n;
    if(dp[n] == 0) dp[n] = fib(n-1) + fib(n-2);
    return dp[n];
}

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

C++: #include <iostream>
using namespace std;
long long fibo(int n){
    long long fibodp[200];
        fibodp[0]=1;
        fibodp[1]=1;
        for(int i=2; i<=n; i++){
            fibodp[i]=fibodp[i-1]+fibodp[i-2];
        }
        return fibodp[n];
}
int main(void){
    int n;
    
    cin>>n;
    std::cout << fibo(n) << std::endl;
    return 0;
    
}

C++: #include <bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
using namespace std;
int main(){
  int f[45];
  f[0]=f[1]=1;
  r(i,2,45)f[i]=f[i-1]+f[i-2];
  int a;cin>>a;
  cout<<f[a]<<endl;
}

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

using namespace std;

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

	long long int f[45];
	int n; cin >> n;

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

	cout << f[n] << "\n";

	return 0;
}

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

int dp[45];

int fib(int n) {
	if (dp[n] != -1)return dp[n];
	int res;

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

	dp[n] = res;
	return res;
}

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

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stdio.h>
#include <math.h>


using namespace std;

typedef long long ll;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<ll> vll;

typedef pair<int, int> P;

typedef queue<int> qi;
typedef queue<string> qs;


#define rep(i, n) for(int i=0; i<(n); ++i)
#define repp(i, a, b) for(int i = (a); i <= (b); i++)
#define Rep(i, n) for(int i=n; i >= 0; i--)

#define all(v) v.begin(), v.end()
//sort( all(v) )　などと使える

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

	vi fib(60, 1);
	rep(i, 50) fib[i + 2] = fib[i + 1] + fib[i];

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

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

int n;
int F[45];
int fibo(int i) {
    if (F[i]) {
        return F[i];
    }
    F[i] =  fibo(i - 1) + fibo(i-2);
    return F[i];
}

int main() {
    cin >> n;
    F[0] = F[1] = 1;
    cout << fibo(n);

    return 0;
}

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

int main(){
   int n;cin>>n;
   int F[50];

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