Go: package main

import "fmt"

func fibonacci() func() int {
	x, y := 0, 1
	return func() int {
		x, y = y, x+y
		return x
	}
}
func main() {
	var n int

	fmt.Scan(&n)
	f := fibonacci()
	for i := 0; i < n; i++ {
		f()
	}
	fmt.Println(f())
}

C++: #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
using namespace std;


typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(v) (v).rbegin(),(v).rend()
#define PB push_back


#define MOD 1000000009LL
#define EPS 1e-8

#define NMAX 44
int F[NMAX];

void initialize(){
	for( int i = 0; i < NMAX;  i++ ){
		F[i] = 0;
	}
}

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

int main(){
	int n;
	scanf("%d", &n);
	int ans = fibonacci(n);
	printf("%d\n", ans);
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> dp(50);
    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;
}

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

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

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

    cout << F[n] << endl;

    return 0;
}

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

int FibonacciNumber(int n) {

	if (n <= 1) {
		return 1;
	}
	return FibonacciNumber(n - 1) + FibonacciNumber(n - 2);
}

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

	cout << FibonacciNumber(n) <<endl;
	
}

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

using namespace std;

#define ll long long
typedef complex<double> P;

int main() {
  int n; cin >> n;
  int p=1, fib=1;
  if(n == 1 || n == 0) cout << 1 << endl;
  else {
    for (int i = 1; i < n; i++) {
      int t = p;
      p = fib;
      fib += t;
    }
    cout << fib << endl;
  }
}

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

#define int long long

#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};

int n;
int dp[55];

signed main(){
    cin.tie(0);
	ios::sync_with_stdio(false);
    cin>>n;
    dp[0]=1;
    dp[1]=1;
    rep(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 F[50];

    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;

    return 0;
}

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

int main(int argc, char const *argv[])
{
  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 main(void)
{
    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-1]+dp[i-2];
    }
    cout<<dp[n]<<endl;
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)

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

    cout << fib[n] << endl;

    return 0;
}

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

int F[MAX];

void Fibonacci(){
  F[0] = 1; 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<bits/stdc++.h>
using namespace std;
int n;
int f[50];
int fib(int k){
	 if (f[k]!=-1)
	    return f[k];
     if (k==0 || k==1) return 1;
	 f[k]=fib(k-1)+fib(k-2);
	 return f[k];	 
}
int main(){
	cin>>n;
	memset(f,-1,sizeof(f));
	cout<<fib(n)<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int num[50];
int fun(int k)
{
    if(num[k]) return num[k];
    if(k==0||k==1) return num[k]=1;
    return num[k]=fun(k-1)+fun(k-2);
}
int main()
{
    int n;
    scanf("%d",&n);
    printf("%d\n",fun(n));
    return 0;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP0(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define RREP0(i,n) for(int i=n-1; i>=0; --i)
#define RREP1(i,n) for(int i=n; i>=1; --i)

#define SORT(c) sort((c).begin(),(c).end())
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define CLR(a) memset((a), 0 ,sizeof(a))

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int INTINF = 2147483647;
const LL LLINF = 9223372036854775807;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
VI F;

int main(int argc, char const *argv[]) {
  cin.tie(0); ios::sync_with_stdio(false);
  int n; std::cin >> n;
  F.reserve(100);
  F.PB(1); F.PB(1);
  for (int i = 2; i <= n; i++) {
    F.PB(F[i-1]+F[i-2]);
  }
  std::cout << F[n] << '\n';
  return 0;
}

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

using namespace std;

#define MAX 45
#define NIL -1
int Memo[MAX];

int fibonacci(int n) {
    if (n == 0 || n == 1)
        return Memo[n] = 1;
    if (Memo[n] != NIL)
        return Memo[n];
    return Memo[n] = fibonacci(n - 1) + fibonacci(n - 2);
}

int main() {
    int n;
    scanf("%d", &n);
    fill_n(Memo, MAX, NIL);
    printf("%d\n", fibonacci(n));
}

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