Go: package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	num, _ := strconv.Atoi(sc.Text())

	fmt.Println(fibonacci(num))
}

func fibonacci(num int) int {
	fibs := make([]int, num+1)

	for i := range fibs {
		if i <= 1 {
			fibs[i] = 1
		} else {
			fibs[i] = fibs[i-1] + fibs[i-2]
		}
	}

	return fibs[num]
}

C++: #if 0

#endif

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

int F[100];

int main() {
  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 "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define IOS std::cin.tie(0),std::ios::sync_with_stdio(false)

namespace idaten {

	using namespace std;
	using ll = int_fast64_t;
	using ull = uint_fast64_t;
	using P = std::pair<int64_t, int64_t>;
	template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
	template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
	template<class Type>struct is_vector : std::false_type {};
	template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
	template <typename T> inline std::ostream& operator << (std::ostream& out, const std::vector<T>& v) {
		if (v.empty())return out;
		constexpr bool is_vector_v = is_vector<T>::value;
		if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
		else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
		return out;
	}
	inline void put() {}
	template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
	template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
	inline void putn() {}
	template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

	void solve() {
		IOS;
		ll n;
		cin >> n;
		vector<ll> dp(n + 1, 0);
		dp[0] = dp[1] = 1;
		FOR(i, 1, n) {
			dp[i + 1] = dp[i] + dp[i - 1];
		}
		put(dp[n]);
	}
} // namespace idaten

int main() {
	idaten::solve();
	return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int n,dp[50];
int main()
{
	dp[0]=1;
	dp[1]=1;
	for(int i=2;i<=50;i++){
		dp[i]=dp[i-2]+dp[i-1];
	}
	scanf("%d",&n);
	printf("%d\n",dp[n]);
	return 0;
}

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

int main(void){
  int n;
  int fib[45];
  fib[0] = 1;
  fib[1] = 1;

  cin >> n;

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

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  int n;
  cin >> n;

  int dp[100] = {};
  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 <stdio.h>
long long fiboDP(int n){
    long long fibodp[200]={0};
    fibodp[1]=1;
    fibodp[2]=1;
    for(int i=3;i<=n;i++){
        fibodp[i]=fibodp[i-1]+fibodp[i-2];
    }
    return fibodp[n];
}
int main(void){
    int n;
    scanf("%d",&n);
    printf("%lld\n",fiboDP(n+1));
   return 0;
}

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

int dp[50];

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


int main() {
	int n, i;
	for (i = 0; i < 50; i++) dp[i] = -1;

	cin >> n;
	cout << fib(n) << endl;

	return 0;
}

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

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

  dp[0]=1;
  dp[1]=1;
  cin >> n;

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

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};
int main() {
    ll N;
    cin >> N;
    
    vector<ll> dp(N+1);
    dp[0] = 1;
    dp[1] = 1;
    rep3(i,2,N+1){
        dp[i] = dp[i-1] + dp[i-2];
    }

       
    cout << dp[N] << endl;



    return 0;
    

}

C++: #include <iostream>
#include <stdio.h>
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++: #include <iostream>
using namespace std;
int main(){
    int n,a[100];
    cin>>n;
    a[0]=1;
    a[1]=1;
    for(int i=2;i<=n;i++){
        a[i]=a[i-1]+a[i-2];
    }
    cout<<a[n]<<endl;
    return 0;
}

C++: #include<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;
}