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 <iostream>
using namespace std;

int fibonacci(int n){
	if(n==0) return 1; //たぶん本当はフィボナッチ数列はf(0)=0 だと思うのだが、問題文がそうなっていたので１を返す。
	else if(n==1) return 1;
	else return fibonacci(n-2) + fibonacci(n-1);
}

int main() {
	int n;

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

	return 0;
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N;
    cin >> N;
    vector<ll> dp(N+1, 0);
    dp[0] = 1;
    dp[1] = 1;
    rep2(i, 2, N+1) {
        dp[i] = dp[i-1] + dp[i-2];
    }
    cout << dp[N] << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

C++: // fibonacci number.
#include<stdio.h>

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

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <tuple>
#include <cassert>
#include <exception>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
#define fprint(NUM,X) cout << fixed << setprecision(NUM) << (X) << endl
#define fprints(NUM,X,Y) cout << fixed << setprecision(NUM) << (X) << " " << (Y) << endl
const ll INF = 1e+9+7;
ll n,m,l;
string s,t;
ll d[200010],dp[550][550];
double w[1000],v[1000];
double box[200010];

ll fib(int i){
  if(i == 1 || i == 0)return 1;
  if(d[i] != 0)return d[i];
  return d[i] = fib(i-1) + fib(i-2);
}

int main(){
  cin >> n;
  print(fib(n));
  return 0;
}

C++: #include <stdio.h>

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;
  scanf("%d",&n);
  printf("%d\n",fib(n));
  return 0;
}

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

long long fib[45];

int main(int argc, char *argv[])
{
    
 
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    fib[0]= 1;
    fib[1] = 1;
    
    for (int i = 2; i < 45; i++) {
        fib[i] = fib[i - 1] + fib[i - 2];
    }
    
    int n;
    cin >> n;
    cout << fib[n] << endl;
    
    return 0;
}

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

typedef long long hyper;

hyper fib(int n)
{
    if(n < 2){ return 1; }
    return fib(n - 1) + fib(n - 2);
}

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

C++: #include <iostream>
#include <string>
#include <math.h>
#define LEN 1000000
using namespace std;

int f[50];
int fib(int);

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

int fib(int a){
	if(f[a]!=-1) return f[a];
	return f[a]=fib(a-1)+fib(a-2);
}

C++: #include<iostream>
#include<vector>
#include<limits.h>
using namespace std;

long long Fib(int n){
	vector<long long> F(n+1);
	int i;
	F[0]=1;
	F[1]=1;
	for (i=2;i<=n+1;i++){
		F[i]=F[i-1]+F[i-2];
	}
	return F[n];
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n;
	cin >> n;
	
	cout << Fib(n)<<endl;
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
int d;
int dd[50];
int fib(int a){
	if(a==0||a==1)return dd[a]=1;
	if(dd[a])return dd[a];
	return dd[a]=fib(a-1)+fib(a-2);
}

int main() {
int c;
cin>>c;
/*for (int i = 0; i < 50; ++i) {
	dd[i]=-1;
}*/

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

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

int main(){
    int n;
    cin >> n;
    int F[50];
    F[0]=1;
    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 <bits/stdc++.h>
using namespace std;

long long f[10000000];

long long fib(int n)
{
  if (n == 0 || n == 1) return (1);
  if (f[n] != 0)  return (f[n]);
  else {
    f[n] = fib(n - 1) + fib(n - 2);
  }
  return f[n];
}
int main()
{
  int n;
  cin >> n;
  cout << fib(n) << endl;
}

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

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

	return 0;
}

C++: #include <cstdio>
#define MAX_N 45
int F[MAX_N] = { 0 };

int fib(const int &n) {
	if (F[n] != 0) return F[n];
	if (n == 0 || n == 1) {
		F[n] = 1;
		return F[n];
	}

	F[n] = fib(n - 1) + fib(n - 2);
	return F[n];
}

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

C++: #include<cstdio>
main(){int n,i=1,f[45]={1,1};for(scanf("%d",&n);++i<=n;f[i]=f[i-1]+f[i-2]);printf("%d\n",f[n]);}

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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;

int fib(int);

int main(void){
    int n; cin >> n;
    cout << fib(n) << endl;

    return 0;
}

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

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repb(i, n) for (int i = (int)n; i >= 0; i--)
#define reps(i, m, n) for (int i = (int)m; i < (int)n; i++)
#define repsb(i, m, n) for (int i = (int)m; i >= (int)n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999999999999
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    int dp[100];
    dp[0] =dp[1]= 1;
    rep(i, n)
    {
        dp[i + 2] = dp[i + 1] + dp[i];
    }
    cout << dp[n] << endl;

    return 0;
}