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 <iostream>
using namespace std;

int Fib(int n) {

	long a[50] = { 1, 1 };

	if (n > 1) {
		for (int i = 2; i <= n; i++)
			a[i] = a[i - 1] + a[i - 2];
		return a[n];
	}
	else
		return 1;
}

int main()
{
	int n = 0;

	cin >> n;

	cout << Fib(n) << endl;

	return 0;
}

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

int fib(int n){
	int ans[45] = {1,1},i;
	for(i=1;i<n;i++){
		ans[i] = ans[i-1]+ans[i-2];
	}
	return ans[i];
}

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

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

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

    int n;
    cin >> n;

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

    cout << dp[n] << endl;

    return 0;
}

C++: #include<iostream>

using namespace std;

int fib(int n);

int memo[1000];

int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

int fib(int n){

  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++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>

using namespace std;


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

	int f1 = 1;
	int f2 = 1;
	int f3 = 0;
	for (int i = 2; i <= n; ++i){
		f3 = f1 + f2;
		f1 = f2;
		f2 = f3;
	}
	if (n == 1){
		cout << 1 << endl;
		return;
	}
	if (n == 2){
		cout << 2 << endl;
		return;
	}
	cout << f3 << endl;

	return 0;
}

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

using namespace std;

class Fibonacci{
private:
  vector<int64_t> fibstore;
public:
  Fibonacci(int num){
    for(int i=0;i<=num;i++){
      fibstore.push_back(0);
    }
    if(num>0){
      fibstore.at(0)=1;
      fibstore.at(1)=1;
    }
  }

  int64_t fibcalc(int num){
    if(fibstore.at(num)!=0) return fibstore.at(num);
     int64_t fib1;
     if(fibstore.at(num-1)==0) fibstore.at(num-1)=fibcalc(num-1);
     fib1=fibstore.at(num-1);

     int64_t fib2;
     if(fibstore.at(num-2)==0) fibstore.at(num-2)=fibcalc(num-2);
     fib2=fibstore.at(num-2);
    return fib1+fib2;
  }
};
int main(void){
  int num;
  cin>>num;
  Fibonacci fib(num);
  cout<<fib.fibcalc(num)<<endl;
  return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
 
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
 
using namespace std;
 
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
 
const int INF=1<<29;
const double EPS=1e-9;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

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

int main(int argc, char const *argv[]) {
	int n;
	cin >> n;
	int ans = fib(n);
	cout << ans << endl;
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> F(50);
    F.at(0) = 1;
    F.at(1) = 1;
    for (int i = 2; i <= n; i++) {
        F.at(i) = F.at(i-1) + F.at(i-2);
    }
    cout << F.at(n) << endl;

    return 0;
}

C++: #include<iostream>
#include<cstdio>

using namespace std;

int main(){
  int n;
  int fibn[1000];
  for(int i=0;i<1000;i++)fibn[i]=-1;
  fibn[0]=fibn[1]=1;
  scanf("%d",&n);
  for(int i=2;i<=n;i++){
    fibn[i]=fibn[i-1]+fibn[i-2];
  }
  cout << fibn[n] << endl;
  return 0;
}

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

vector<long long int> fibonatti;
long long int  dp[10000];
int calc(int n){
  if(n <= 1) return 1;
  if(dp[n] != -1)return dp[n];
  fibonatti[n] = calc(n - 1) + calc(n - 2);
  return dp[n] = fibonatti[n];
}

int main(int argc, char *argv[]){
  int n;
  cin >> n;
  fibonatti.resize(n + 1);
  fibonatti[0] = fibonatti[1] = 1;
  for (int i = 0; i <= n; i++) {
    dp[i] = -1;
  }
  dp[0] = dp[1] = 1;
  std::cout << calc(n) << std::endl;
  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++: #define PI 3.14159265359
#define INF 2000000000
#define MAX 500000
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
typedef long long ll;

ll F[45]={0};

ll fibo(int n){
    if(F[n]) return F[n];
    if(n==0||n==1) return F[n]=1;
    return F[n]=fibo(n-1)+fibo(n-2);
}

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

C++: #include <cstdint>

using namespace std;

#define MEMO_SIZE 44
int64_t memo[MEMO_SIZE];

void fib_init()
{
  for (uint32_t i = 0; i < MEMO_SIZE; i++) {
    memo[i] = -1;
  }
}

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

#include <iostream>

int32_t main()
{
  fib_init();
  uint32_t i;
  cin >> i;
  cout << fib(i) << endl;
  return 0;
}

C++: #include <iostream>
#include <map>

using namespace std;

int fib(int n);

map<int, int> fib_array;


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

	cout << fib(input) << endl;
	return 0;


}

int fib(int n){
	switch (n)
	{
	case 0:
	case 1:
		return 1;
		break;
	default:
		break;
	}
	
	if (fib_array[n] == 0){
		int new_fib = fib(n - 1) + fib(n - 2);
		fib_array[n] = new_fib;
		return new_fib;
	}
	else{
		return fib_array[n];
	}

}