Go: package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)

	fmt.Fprintln(writer, fib(n))
	writer.Flush()

}

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

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
using namespace std;
using P = pair<int, int>;
typedef long long ll;
vector<ll> memo(45, -1);


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


int main() {
  ll n;
  cin >> n;
  memo[0] = 1;
  memo[1] = 1;
  cout << fib(n) << endl;
}

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

int main(void){
    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;
}

C++: #include <cstdio>

int main()
{
    int n;
    scanf("%d", &n);
    int ans=1;
    int old=1, older=1;
    for(int i=2; i<=n; i++){
        older=old;
        old=ans;
        ans=(old+older);
    }
    printf("%d\n", ans);
    return 0;
}

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

}

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++)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
template<class T> using V = vector<T>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



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

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;
    int fib1 ,fib2 ,fib3;
    fib1 = fib2 = fib3 = 1;
    rep(i,n-1) {
        fib3 = fib1 + fib2;
        fib1 = fib2;
        fib2 = fib3;
    }
    cout << fib3 << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
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; }

const int MOD = 1000000007;
const int INF = 1e9;

const int mod = 1000000007;
const int inf = 1e9;
#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

ll dp[50];

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

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

int main() {
	void fibonacci_1(const int count , int data[]) {
	data[0] = 1;
	if(count == 1) return;
	data[1] = 1;
	
	for( int i = 2; i < count ; i++) {
		data[i] = data[i-1]+data[i-2];
	}
}
	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;
int n;
int fib[100];
int main()
{
    cin >> n;
    fib[0] = 1; fib[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        fib[i] = fib[i - 1] + fib[i- 2];
    }
    cout << fib[n] << endl;
}