Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;

int dp[100];
int N;

int main() {
	cin >> N;
	rep(i, N+1){
		if(i == 0 || i == 1) dp[i] = 1;
		else dp[i] = dp[i-2] + dp[i-1];
	}
	cout << dp[N] << endl;
}

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

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

int main(){
    cin >> N;
    cout << fib(N) << endl;
}

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

int main(){
	int n;
	vector<int> fib;

	cin>>n;
	for(int i=0;i<=n;i++){
		if(i <= 1)
			fib.push_back(1);
		else
			fib.push_back(fib[i-1]+fib[i-2]);
	}
	
	cout<<fib[n]<<endl;

	return 0;
}

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

int main() {
    int n;
    cin >> n;
    int fib[50];
    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 <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int, int>;

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 <bits/stdc++.h>
using namespace std;

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

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

C++: #include<iostream>
using namespace std;
int main()
{	int n;
	long long int a[45];
	a[0]=a[1]=1;
	for(int i=2;i<=44;i++)
		a[i]=a[i-2]+a[i-1];
	cin>>n;
	cout<<a[n]<<endl;
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

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

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

ll dp[1000000];

ll fib(ll n){
    if(dp[n] >= 0) return dp[n];

    if(n == 0) dp[n] = 0;
    else if(n == 1) dp[n] = 1;
    else dp[n] = fib(n-1) + fib(n-2);
    return dp[n];
}

int main(){
    ll n; cin >> n;
    memset(dp, -1, 1000000*sizeof(ll));

    cout << fib(n+1) << endl;
    return 0;
}

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

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

	// F[0] から F[n] までの分のメモリを確保
	vector<long long> dp(n + 1, 0);

	// 初期条件
	dp[0] = 1;
	dp[1] = 1;

	// DP の遷移を行う
	for (int i = 2; i <= n; ++i) {
		dp[i] += dp[i - 1];
		dp[i] += dp[i - 2];
	}

	// 答え
	cout << dp[n] << endl;
}

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

int main() {
    int n;
    cin>>n;
    int fib[100];
    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>
#include<stdio.h>
using namespace std;
int main(void){
    int n,f[45];
    cin>>n;
    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<iostream>
#include<vector>
using namespace std;

int main(void){
	int n,v[50];
	cin>>n;
	if(n == 0 || n == 1){
		cout<<1<<endl;
	}else{
		v[0] = v[1] = 1;
		for(int i = 2 ; i <= n ; i ++){
			v[i] = v[i-1] + v[i-2];
		}
		cout<<v[n]<<endl;
	}
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

int main(){
  int n;
  int a[45];
  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;

}

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

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