Go: package main

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

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

C++: #include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <complex>

#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define rep(i,n) for(int i=0;i<(n); i++)


using namespace std;
int main(){
	cin.tie(0);
    ios::sync_with_stdio(0); //この2行はより速度を向上させる
	// 追加２, 以降 cin の入力元が 'input.txt' になる
	//提出時に消す！！
	//std::ifstream in("sample.txt");
	//std::cin.rdbuf(in.rdbuf());

	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;
    int d[45]={1,1};
    for(int i=2;i<=n;++i) d[i]=d[i-1]+d[i-2];
    cout<<d[n]<<endl;
}

C++: #include <algorithm>
#include <cmath>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cstring>
#include <tuple>
#include <bitset>
#include <unordered_map>
using namespace std;
typedef long long ll;

int const SIZ = 50;
int fib[SIZ];

void prepare() {
    fib[0] = fib[1] = 1;
    for (int i=2; i<SIZ; ++i) {
        fib[i] = fib[i-1] + fib[i-2];
    }
}

int main() {
    ios::sync_with_stdio(false);

    prepare();

    int n;
    cin >> n;
    cout << fib[n] << endl;

    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
#include <cctype>

using namespace std;

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

int memo[45];

long fib(int n)
{
	if(n <= 1)
		return 1;
	if(memo[n] != 0) return memo[n];
	return memo[n] = fib(n - 1) + fib(n - 2);
}

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

	cout << fib(n) << endl;
	return 0;

}

C++: /*
    フィボナッチ数列
    https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/10/ALDS1_10_A
*/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

ll fibonacci(ll n) {
    if (n == 0 || n == 1)
        return 1;

    ll n1 = 1, n2 = 1, n3 = 0;
    n3 = n1 + n2;
    for (ll i = 0; i < n - 2; i++) {
        n1 = n2;
        n2 = n3;
        n3 = n1 + n2;
    }
    return n3;
}

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

    ll n;
    cin >> n;

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

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

#define int long long
#define double long double

#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define ALL(v) (v).begin(), (v).end()

#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

using pi = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vb = vector<bool>;
using vpi = vector<pi>;
using vvi = vector<vi>;
using vvb = vector<vb>;

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

vi memo(100, 0);

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

signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    int n; cin >> n;
    memo[0] = memo[1] = 1;
    cout << fib(n) << endl;
}

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

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

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

int solve(int n, vector<int> &v)
{
  if(v[n] == 0)
    v[n] = solve(n-1, v) + solve(n-2, v);
  return v[n];
}

int main()
{
  vector<int> fib(45);
  fib[0] = fib[1] = 1;
  int n; cin>>n;
  solve(n, fib);
  cout << fib[n]<<"\n";
}