Go: package main

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

//util
var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

C++: #include <bits/stdc++.h>
using namespace std;
long long a[1005];
int main(){
//	freopen("a.txt","r",stdin);
	a[0]=a[1]=1;
	for(int i=2;i<=44;i++)
		a[i]=a[i-2]+a[i-1];
	int n;cin>>n;cout<<a[n]<<endl;
	return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
#define ll long long 

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

    vector<ll> 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;
}

C++: #include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
using namespace std;
const int64_t MOD = 1e9 + 7;

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

	vector<int> v(50);
	for (int i = 0; i < 50; i++) {
		if (i <= 1) v.at(i) = 1;
		else v.at(i) = v.at(i - 1) + v.at(i - 2);
	}

	cout << v.at(n) << endl;
}

C++: #include <stdlib.h>
#include <stdio.h>

int fib(int n){
int i;
int a[44];
a[0]=a[1]=1;
for(i=2;i<=n;i++){
a[i]=a[i-1]+a[i-2];
   }
return a[n];
}

int main(){

int x,n;
scanf("%d",&n);
x=fib(n);
printf("%d\n",x);

return 0;
}

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

using namespace std;

const double PI = 3.14159265358979;


const vector<int>* fibon_seq(int size) {

	static vector<int> elems;
	for (int i = elems.size(); i <= size; i++) {
		if (i == 0 || i == 1)
			elems.push_back(1);
		else
			elems.push_back(elems[i - 1] + elems[i - 2]);
	}
	return &elems;
}




int main() {

	int n; cin >> n;
	vector<int>  res = *fibon_seq(n);

	cout << res[n] << endl;

	return 0;
}

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

int N;
int memo[50];

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

int main(void) {

    cin >> N;

    for (int i = 0; i < 50; ++i) memo[i] = -1;

    cout << fibo(N) << endl;

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef pair<ll, ll> P;

const ll mod =  1000000007;  //出力は (ans % mod + mod) % mod  (負の剰余を正にする)
const int inf = 1e9;
const long long INF = 1LL << 60;   // INF = 11

int main()
{
    int n; cin >> n;
    ll fib[n+1];
    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;
}

C++: #include <iostream>
#define rep(i,a) for(int i=0;i<(a);++i)

int fib[45];
int n;

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

  fib[0] = fib[1] = 1;
  rep( i, n-1 )
    fib[i+2] = fib[i] + fib[i+1]; 

  std::cout << fib[n] << std::endl;

  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int n;
int a[50];


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

  return 0;
}

C++: #include<cstdio>
#define MAX 45
int F[MAX];

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

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

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

	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 main()
{
        int n;
        cin >> n;
        if (n <= 1) {
                cout << 1 << endl;
                return 0;
        }

        int *fib = new int[n + 1];
        fib[0] = fib[1] = 1;
        for (int i = 2; i <= n; i++) {
                fib[i] = fib[i - 1] + fib[i - 2];
        }
        cout << fib[n] << endl;
        delete [] fib;

        return 0;
}

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

#define N_MAX 45

int table[N_MAX];

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

int main()
{
	for(int i=0; i<N_MAX; i++) table[i] = 0;
	
	int n;
	cin >> n;
	cout << fib(n) << endl;

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(ll i=0;i<N;++i)
typedef long long int ll;
ll INF = 1LL<<60;

// フィボナッチ数列の第n項の出力
ll dp[1010];

int main(){
    ll N;
    cin >> N;
    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>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
typedef long long int ll;

ll a[50];

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

C++: #include"iostream"
using namespace std;
int n;
int main()
{
	cin >> n; 
	if (n == 1 || n == 0){
		cout << 1 << endl;
	}
	long long a=1, b=1,c;
	for (int i = 1; i < n; i++)
	{
		c = a + b;
		a = b;
		b = c;
	}
	cout << c << 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<algorithm>
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;

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

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

    cout << fibonacci(n) << endl;

    return 0;
}

C++: // -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_10_A: Fibonacci Number

#include <algorithm>
#include <cstdio>

#define NDEBUG
#include <cassert>

class Fibonnacci {
  static const unsigned int N = 44u;
  unsigned int n_;
  unsigned long* f_;

public:
  Fibonnacci(unsigned int n = N) : n_(std::max(1, n))
  {
    f_ = new unsigned long[n_+1];
    f_[0] = f_[1] = 1;
    for (auto i = 2u; i <= n; ++i) {
      f_[i] = f_[i-1] + f_[i-2];
    }
  }

  ~Fibonnacci() { delete[] f_; }
  
  unsigned long operator () (unsigned int n) const
  {
    assert(n <= n_);
    return f_[n];
  }
};

int main()
{
  unsigned int n;
  std::scanf("%u", &n);
  Fibonnacci fib;
  std::printf("%lu\n", fib(n));
}

// eof