Go: package main

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

const max int = 44
var ans []int = make([]int, max+1)

func generateFib() {
	ans[0] = 1
	ans[1] = 1
	for i:=2; i<=max; i++ {
		ans[i] = ans[i-1] + ans[i-2]
	}
}

func nextInt(scanner *bufio.Scanner) int {
	scanner.Scan()
	num, _ := strconv.Atoi(scanner.Text())
	return num
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	i := nextInt(scanner)
	generateFib()
	fmt.Printf("%d\n", ans[i])
}

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

using namespace std;

long long fib[45];

int main(void) {

    int n;
    cin >> n;

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

    printf("%lld\n", fib[n]);

    return 0;
}

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

const int MAX_N = 44;

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

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

int F[MAX];

void Fibonacci(){
  F[0] = 0; F[1] = 1;
  for( int i = 2 ; i < MAX ; i++ ) F[i] = F[i-2] + F[i-1];
}

int main(void){
  Fibonacci();
  int i;

  cin >> i;
  cout << F[i] << endl;

  return 0;
}

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

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

C++: #include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
#define NIL -2000000001
#define MAX 2000

int A[MAX];
int n = 0;

int fib(int num) {
  if (A[num] != NIL) {
    return A[num];
  } else {
    return fib(num-1)+fib(num-2);
  }
}

int main() {
  int num;
  for ( int i = 0; i < MAX; i++ ) {
    A[i] = NIL;
  }
  A[0] = 1;
  A[1] = 1;
  scanf("%d", &num);
  printf("%d\n", fib(num));
  return 0;
}

C++: #include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

  vector<int> fib(n + 1, 1);
  for (int i = 2; i <= n; ++i) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }

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

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

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

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

    return 0;
}

C++: #include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
map<int, int>dp;
int fib(int N) {
   if (N == 0 || N == 1) {
       return 1;
   } else if (dp.count(N) > 0) {
        return dp[N];
    }

    int ans = fib(N-1) + fib(N-2);
    dp[N] = ans;
    return ans;
}
int main() {
    int N;
    cin >> N;
    dp[0] = 1;
    dp[1] = 1;
    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>
using namespace std;
long long fibo(int n){
    int F[n];
    F[0] = F[1] = 1;
	for(int i = 2; i <= n; i++)
        F[i] = F[i-1]+F[i-2];
	return F[n];
}

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

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

int dp[50];

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

int main() {
  int n, i;
  cin >> n;
  for (i = 0; i < 50; i++) {
    dp[i] = -1;
  }
  
  scanf("%d", &n);
  printf("%d\n", fib(n));
  
  return 0;

}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(n); ++i)
#define repr(i, a, b) for (int i=a; i<(b); ++i)
#define reprev(i, n) for (int i=n-1; i>=0; --i)
#define reprrev(i, a, b) for (int i=b-1; i>=(a); --i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    cout << fixed << setprecision(10);
    
    int n; cin >> n;
    vector<int> fib(n+1);
    fib[0] = 1; fib[1] = 1;
    repr(i, 2, n+1) {
        fib[i] = fib[i-2] + fib[i-1];
    }
    cout << fib[n] << endl;
    return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, 1, -1, 0};

int main(void){
	int n; cin >> n;
	int dp[100];
	dp[0] = dp[1] = 1;
	reps(i, 2, n + 1){
		dp[i] = dp[i - 1] + dp[i - 2];
	}

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

C++: #include <iostream>

using namespace std;

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

  // 初期化
  dp[0] = 1;
  dp[1] = 1;

  //入力
  cin >> n;

  // DP
  for(int i = 2; i <= n; i++) dp[i] = dp[i-1] + dp[i-2];

  // 出力
  cout << dp[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 <vector>

using namespace std;

int fib(int);

vector<int> num;

int main(){
    int n;
    cin >> n;
    
    num.resize(n, 0);
    
    cout << fib(n) << endl;
}

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

C++: #include <iostream>

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

int fib = 0;
std::cin>>fib;
std::cout<<fib(n)<<std::endl;