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++: #include <stdio.h>
#include <iostream>
using namespace std;

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

	cin >>n;

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

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

C++: #inclue<stdio>
#include<stream>
using namespace std;

int fibo(int x) {
  int a;
  if ( x == 0 ) return 1;
  if ( x == 1 ) return 1;
  a = fibo(x-1) + fibo(x-2);
  return a;
}

int main() {
  int x, y;

  cin >> x;

  y = fibo(x);

  cout << y << endl;

  return 0;
}

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

C++: #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define ALL(a) a.begin(), a.end()
ll dx[4] = { 0, 1, 0, -1 };
ll dy[4] = { 1, 0, -1, 0 };
const ll INF = 1e14;
const ll MOD = 1e9 + 7;
#define MAX_N 45
int dp[MAX_N];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    dp[0] = dp[1] = 1;
    for (int i = 2; i < n + 1; i++) {
        dp[i] = dp[i - 1] + dp[i - 2];
    }
    cout << dp[n] << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;



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

C++: #include <iostream>

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

    int r1 = 1;
    int r2 = 1;
    int result = 1;

    if (n == 1) {
        std::cout << 1 << std::endl;
    } else {
        for (int i = 1; i < n; i++) {
            int tmp = r1;
            r1 = r2;
            r2 = result;
            result += r1;
        }
        std::cout << result << std::endl;
    }
}

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

int main(){
  int f[45];

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

  int n; cin >> n;
  cout << f[n] << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <cctype>
#include <cstdio>
#include <iomanip>
#include <functional>
#include <stack>
#define PI 3.1415926535
#define INF 114514810
#define FOR(i, r, n) for(int i=(r); i<(n); i++) 
#define REP(i, n) FOR(i, (0), n)

using namespace std;

long long int n;

int fib(int k){
	if (k == 0 || k == 1) return 1;
	return fib(k - 1) + fib(k - 2);
}

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

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

using namespace std;

int main() {

	int n;
	cin >> n;

	int oold = 1;
	int old = 1;
	int neww;

	if (n == 0 || n == 1) { cout << 1 << endl; return 0; }

	for (int i = 2; i <= n; i++) {
		neww = old + oold;
		oold = old;
		old = neww;
	}

	cout << neww << endl;

	return 0;

}

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

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

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

#define FOR(i, a, b) for(int i = (a); i < (b); i++)

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

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

int main() {
	int n;
	cin >> n;
	int dp[45];
	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 <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
using namespace std;

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

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

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

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

const int N = 44;
int dp[N] = {};
int n;

int rec(int x)
{
	if(x == 0 || x == 1){
		dp[x] = 1;
		return dp[x];
	}
	
	if(dp[x] != 0)
		return dp[x];
	
	return dp[x] = rec(x - 1) + rec(x - 2);
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> n;
	
	cout << rec(n) << endl;
	
	return 0;
}

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

const int MAX = 100;
long long dp[MAX];

long long fb(int n) {
  if (n < 2) {
    return 1;
  }
  if (dp[n] != 0) {
    return dp[n];
  } else {
    return dp[n] = fb(n-1) + fb(n-2);
  }
}

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

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

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