Go: package main

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

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

C++: #define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <list>

long long int INF = 1e18;
using namespace std;

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

int main(){
	
	int n;
	cin >> n;
	
	long long 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;
	
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<iomanip>
#include<set>
#include<map>
#include<utility>
#include<string>
#include<vector>

using namespace std;

#define LL long long

LL n,fib[50];

int main() {
	cin>>n;
	for(int i=0;i<=n;i++){
		if(i==0||i==1)fib[i]=1;
		else fib[i]=fib[i-1]+fib[i-2];
	}
	cout<<fib[n]<<endl;
	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;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
typedef long long int ll;
ll Dp[50];
int main()
{
for(int i=2;i<50;i++)Dp[i]=Dp[i-1]+Dp[i-2];
int N;
cin >> N;
cout << Dp[N] << "\n";

return 0;
}

C++: #include <bits/stdc++.h>
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++)
typedef long long ll;

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

C++: #include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;

int n,a[55];

int main() {
	cin>>n;
	a[0]=a[1]=1;
	for (int i=2;i<=n;i++) a[i]=a[i-1]+a[i-2];
	cout<<a[n]<<'\n';
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
//using ll = long long;
//using P = pair<int, int>;
 
int fib[50];

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

C++: #include <iostream>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

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

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

int main() {
  int N; cin >> N;
  int dp[45];
  dp[0] = dp[1] = 1;
  rep(i, 1, N) dp[i + 1] = dp[i] + dp[i - 1];
  cout << dp[N] << endl;
  return 0;
}

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

//短縮
#define rep(i,n) for(int i=0;i<(n);++i)
//sort()用
#define all(v) v.begin(), v.end()

using namespace std;

using Graph = vector<vector<int>>;

int main(){
  int n;
  cin >> n;
  int n1=1,n2=1;
  vector<int> fib(n+1);
  fib.at(0)=1;
  fib.at(1)=1;
  for(int i=2;i<=n;i++){
    fib.at(i)=fib.at(i-1)+fib.at(i-2);
  }
  cout << fib.at(n)<< endl;
  return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <utility>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

int f[45] = {};

int fib(int i)
{
    if (f[i] > 0)
        return f[i];

    if (i == 0 || i == 1)
    {
        f[i] = 1;
    }
    else
    {
        f[i] = fib(i-1) + fib(i-2);
    }
    return f[i];
}

int main()
{
    int n;
    cin >> n;
    cout << fib(n) << "\n";
    return 0;
}

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

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

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A
// Dynamic Programming - Fibonacci Number

#define SUBMIT

#include <utility>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <limits>
#include <numeric>
#include <functional>
#include <set>
#include <cmath>
#include <cstring>
#include <climits>
#include <memory>

using namespace std;
using ui64 = unsigned long long;
using i64 = long long;

const ui64 MAX_N = 44;
int dp[MAX_N + 1];

int main() {
    // initialize
    memset(dp, 0, sizeof(dp));
    dp[0] = 1, dp[1] = 1;

    for (int i = 2; i <= MAX_N; ++i) dp[i] = dp[i - 1] + dp[i - 2];

    int n;
    cin >> n;

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

C++: #include<iostream>

using namespace std;
int fib(int n);

int memo[45];
int main(){
  int n;
  cin >> n;
  cout << fib(n) << endl;
  retrun 0;
}

int bib(int n){

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

  }

C++: #include <iostream>
#include <unordered_map>
using namespace std;
int fib(int);
unordered_map<int, int> memoFib;

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

int fib(int n) {
  if(memoFib.count(n)) return memoFib[n];
  int a;
  a = memoFib[n] = n == 0 || n == 1 ? 1 : fib(n - 1) + fib(n - 2);
  return a;
}