Go: package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n, err := nextInt(sc)
	if err != nil {
		panic(err)
	}
	fmt.Println(fibonacci(n, make(map[int]int)))
}

func fibonacci(x int, memo map[int]int) int {
	if x == 0 || x == 1 {
		return 1
	}
	if y, ok := memo[x]; ok {
		return y
	}
	z := fibonacci(x-1, memo) + fibonacci(x-2, memo)
	memo[x] = z
	return z
}

func nextInt(sc *bufio.Scanner) (int, error) {
	sc.Scan()
	return strconv.Atoi(sc.Text())
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <utility>
#include <iostream>
#include <algorithm>
#include <functional>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define ll long long
#define ull unsigned long long
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define eps 1e-9
#define P pair<int, int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pul pair<ull, ull>
#define all(a) (a).begin(), (a).end()
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

void YES() { cout << "YES\n"; }
void NO() { cout << "NO\n"; }
void Yes() { cout << "Yes\n"; }
void No() { cout << "No\n"; }
void yes() { cout << "yes" << endl; }
void no() { cout << "no" << endl; }

template<class T>
T fibonacci(T n) {
	T first = 1, second = 0, ans;
	for (int i = 0; i < n; ++i) {
		if (i == 1)
			second = 1;
		ans = first + second;
		first = second;
		second = ans;
	}
	return ans;
}

int main() {
	int n;
	cin >> n;
	cout << fibonacci(n + 1) << endl;

	return 0;
}

C++: #include <iostream>
using namespace std;
int n,a[45];

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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <string>
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>

using namespace std;

// ---------------------
// repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

// debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

// ---------------------
#define INF 922337203685477580
typedef long long ll;

int dp[50];

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

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

  REP(i, 50) {
    dp[i] = -1;
  }

  cout << fib(X) << endl;
  return 0;
}

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

int n, a[45];

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()		//sort(all(vi S)) sort(all(string S))

typedef long long ll;
typedef vector<int> vi;
typedef set<int> seti;
typedef vector<string> vs;

const int MOD = 1e9+7;
const int INF = 1e9;

int main() {
	int N;
	cin>>N;
	ll F[100];
	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 <iostream>

using namespace std;

int main(){
  long long int a = 1, b = 1;
  int n; cin >> n;

  for(int i=0;i<n;++i){
    long long int c = a + b;
    a = b;
    b = c;
  }
  cout << a << endl;

  return 0;
}

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

int fib(int n, int a, int b);

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


int fib(int n, int a, int b){
	int f;
	if (n != 0){
		f = fib(n - 1, a + b, a);
  }
	else f = a + b;
	return (f);
}

C++: #include<iostream>
using namespace std;
int fib(int n)
{
    int F[50];
    if(n<=1) return 1;
    for(int i = 2 ; i < =n; i++)
    {
        F[i] = F[i-1] + F[i-2];
    }
    return F[n];
}

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

C++: #include <iostream>

using namespace std;

int ans[45] = 0;

int fib(int n) {
	if (n <= 1) return 1;
	int a = ans[n];
	if (a) return a;
	a = fib(n-1) + fib(n-2);
	ans[n] = a;
	return a;
}

int main()
{
	int i = 0;
	cin >> i;
	cout << fib(i) << endl;
}

C++: #define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


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


int main(int argc, const char * argv[]) {
    
    //Input
    int n;
    scanf("%d", &n);
    
    printf("%d\n", fib(n));
           
    return 0;
}

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

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

  int n; cin >> n;
  vector<int> f(n+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 <cstdio>

using namespace std;

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

int main() {
    int n;
    scanf("%d", &n);
    printf("%d", fibonacci(n));
}

C++: #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    int a[50];
    a[0] = 1;
    a[1] = 1;
    for(int i = 2;i < 50;i++)
        a[i] = a[i-1]+a[i-2];
    cout << a[n] << endl;
    return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main(){

	int n;
	cin>>n;
	std::vector<int>a(n);
	a[0]=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 <bits/stdc++.h>
using namespace std;


int n;

int memo[50];

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

int main(){
	scanf("%d", &n);

	for(int i=0;i<50;i++)memo[i] = -1;
	printf("%d\n",fibo(n));
	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<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>
#include<cctype>

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VII;
typedef pair<int,int> PII;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int dp[45] = {1,1};

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	
	for(int i = 2;i < n + 1;i++){
		dp[i] = dp[i - 1] + dp[i - 2];
	}
	cout << dp[n] << endl;

	return 0;
}

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

int main()
{
	int F[45],n;
	F[0] = F[1] = 1;
	for (int i = 2; i <= 44; i++)
		F[i] = F[i - 1] + F[i - 2];
	scanf("%d", &n);
	printf("%d\n", F[n]);
	return 0;
}

C++: #include<stdio.h>

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

int main()
{
  int n;

  scanf("%d",&n);

  n = fib(n);

  printf("%d\n",n);

  return 0;
}