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>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	int n;
	cin>>n;
	ll dp[47];
	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;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
 
static const int N= 100;
int p[N+1], m[N+1][N+1];
 
int main() {
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    for(int i=1; i<=n; i++){
      cin >> p[i-1] >> p[i];
    }
    for(int i=1; i<=n; i++) m[i][i] = 0;
 
    for(int l=2; l<=n; l++){
      for(int i=1; i<=n-l+1; i++){
        int j = i + l -1;
        m[i][j] = ( 1 << 21);
        for(int k=i; k<=j-1; k++){
          m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j]);
        }
      }
    }
    cout << m[1][n] << endl;
}

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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using namespace std;

using ll=long long;
using pii=pair<int, int>;
using vi=vector<int>;

const ll INF=1LL<<60;
const int MOD=1e9+7;

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

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
 int a=1;
 int b=1;
 int n;
 cin >>n;
 if(n%2==0){
   for(int i=0;2*i<n-2;i++){
    a+=b;
    b+=a;
   }
    cout << b << endl;
   }else{
       for(int s=0;2*s<n-1;s++){
           a+=b;
           b+=a;
       }
    cout << a << endl;
   }
}

C++: #include<stdio.h>

int dq[50];

int fib(int n) {
	if (n == 0 || n == 1)return dq[n] = 1;
	if (dq[n] != -1)return dq[n];
	return dq[n] = fib(n - 1) + fib(n - 2);
}

int main() {
	int n, i;
	for (i = 0; i < 50; i++) {
		dq[i] = -1;
	}

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

	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<cstdio>
int F[45];
int n;
int fibonacci(int n){
	if(n == 0 || n == 1){
		return F[n] = 1;
	}
	if(F[n] != 0){
		return F[n];
	}
	return F[n] = fibonacci(n-2) + fibonacci(n-1);
}

int main(){
	int i;
	for(i=0;i<45;i++){
		F[i] = 0;
	}
	scanf("%d",&n);
	printf("%d\n",fibonacci(n));
	return 0;
}

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

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

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

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

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

int makeFibonacci(int n) {
	int a[100];
	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(void) {
	int n;
	cin >> n;

	int ans = makeFibonacci(n);

	cout << ans << endl;

	return 0;

}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   for(int i=0;i<(n);++i)
#define SORT(c)    sort((c).begin(),(c).end())
#define CLR(a)     memset((&a), 0 ,sizeof(a))//clear memory
#define dump(x)    cerr << #x << " = " << (x) << endl;//debug
#define debug(x)   cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define EPS        1e-10//sample:if((double)>=(double)+EPS)
//cin,cout release
//std::cin.tie(0);
//ios::sync_with_stdio(false);

using namespace std;
unsigned long long int a[100000]={};
unsigned long long int fib(long long int n){
  if(a[n]!=0)return a[n];
  if(n==0)return 1;
  if(n==1)return 1;
  return a[n]=fib(n-1)+fib(n-2);
}


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

C++: 
//DP-1

#include<iostream>
#include<stdio.h>


using namespace std;


int main()
{
    int i,n;
    //メモ化のための配列
    int dp[50];
    scanf("%d",&n);
    dp[0]=1;
    dp[1]=1;

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

}

C++: #include<stdio.h>

int d[50];

int fi(int n)
{
  if(n==0 || n==1) return d[n] = 1;
  if(d[n] != -1) return d[n];
  return d[n] = fi(n-1) + fi(n-2);
}

int main()
{int n,i;
  for(i=0;i<50;i++) d[i] = -1;
  scanf("%d",&n);
  printf("%d\n",fi(n));

  return 0;
}

C++: #include"iostream"
using namespace std;
int n;
int main()
{
	cin >> n; 
	if (n == 1 || n == 0){
		cout << 1 << endl; return 0;
	}
	long long a=1, b=1,c;
	for (int i = 1; i < n; i++)
	{
		c = a + b;
		a = b;
		b = c;
	}
	cout << c << endl;
	return 0;
}

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