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 <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

ll n;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    vll fib(n + 1, 1);
    for (ll i = 2; i <= n; i++) fib[i] = fib[i - 2] + fib[i - 1];
    cout << fib[n] << '\n';
    return 0;
}

C++: #include<iostream>

using namespace std;
int fib(int n);
int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

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

C++: #include <iostream>

using namespace std;

int solve(int n)
{
    int sum[3] = {1, 1, 1};
    if (n < 2)
        return 1;
    for (int i = 1; i < n; i++)
    {
        sum[2] = sum[1] + sum[0];
        sum[0] = sum[1];
        sum[1] = sum[2];
    }
    return sum[2];
}

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

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[100] = {1,1};
int a[100] = {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<bits/stdc++.h> 
using namespace std; 
long long n,f[49],x=1;
int main()
{
    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;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

//行列は二次元vectorを用いるようにする
typedef vector<int> vec;
typedef vector<vec> mat;

//A*Bの計算
mat mul(mat &A, mat &B){
    mat C(A.size(), vec(B[0].size()));
    for(int i = 0; i < A.size(); i++){
        for(int k = 0; k < B.size(); k++){
            for(int j = 0; j < B[0].size(); j++){
                C[i][j] = (C[i][j] + A[i][k] * B[k][j]);
            }
        }
    }
    return C;
}

//A^nの計算
mat pow(mat A, long long n){
    mat B(A.size(), vec(A.size()));
    for(int i = 0; i < A.size(); i++){
        B[i][i] = 1;
    }
    while(n > 0){//繰り返し二乗法
        if(n & 1) B = mul(B, A);
        A = mul(A, A);
        n >>= 1;
    }
    return B;
}

ll n;

void solve(){
    mat A(2, vec(2));
    A[0][0] = 1; A[0][1] = 1;
    A[1][0] = 1; A[1][1] = 0;
    A = pow(A, n);
    cout << A[0][0] << endl;
}

signed main(){
    cin >> n;
    solve();
}

C++: #include<iostream>

using namespace std;

int main(){

  int n;

  int n0,n1,st;
  //initialize
  n0=0;
  n1=1;
  
  //load number
  cin >>n;
  //fibonacci
  for(int i=1;i<=n;i++){
    st=n0+n1;
    n0=n1;
    n1=st;
  }
  //print
  cout <<st<<endl;
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
static int64_t fib(int32_t n) {
  if (n < 0 || 44ll < n) {
    return -1;
  }
  if (n == 0 || n == 1ll) {
    return 1ll;
  }
  int64_t a = 1ll, b = 1ll;
  for (int32_t i = 2; i <= n; ++i) {
    int64_t t = a + b;
    a = b, b = t;
  }
  return b;
}
int main() {
  int32_t n;
  cin >> n;
  cout << fib(n) << endl;
}

C++: #include <iostream>
#define MAX 45

using namespace std;

int f[MAX];

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

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

C++: #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <iostream> // cout, endl, cin
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<long long> fib(n + 1);
	fib.at(0) = 1;
	fib.at(1) = 1;
	for (int i = 2; i <= n; i++) {
		fib.at(i) = fib.at(i - 1) + fib.at(i - 2);
	}
	cout << fib.at(n) << endl;
}