Go: package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

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

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

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

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

long long fib_(int n,long long a,long long b){
  if(n==2) return a+b;
  return fib_(n-1,b,a+b);
}

long long fib(int n){
  if(n==0) return 1;
  if(n==1) return 1;
  return fib_(n,1,1);
}


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

C++: #include<iostream>
#include<vector>
using namespace std;
int main(){

	int n;
	cin>>n;
	std::vector<int>a(n);
	a[0]=a[1]=1;
	for(int i=2;i<=n;i++)
		a[i]=a[i-1]+a[i-2];

	cout<<a[n]<<endl;
	
	return 0;
}

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

int main()
{
	int fib[45];
	int n,i;
	
	//???????????????
	for(int i=0; i<45; i++){
		fib[i]=0;
	}
	fib[0]=1;
	fib[1]=1;
	
	cin >> n;
	
	if(n!=0||n!=1){
		for(i=2;n>=i;i++){
			fib[i]=fib[i-1]+fib[i-2];
		}
	}
	
	cout << fib[n];
	return 0;
	
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>

using namespace std;


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

	int f1 = 1;
	int f2 = 1;
	int f3 = 0;
	for (int i = 2; i <= n; ++i){
		f3 = f1 + f2;
		f1 = f2;
		f2 = f3;
	}
	if (n == 1){
		cout << 1 << endl;
		return 0;
	}
	if (n == 2){
		cout << 2 << endl;
		return 0;
	}
	cout << f3 << endl;

	return 0;
}

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

int main() {
  int n, fib[50];

  cin >> n;

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

  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string>

using namespace std;

int fib(int n)
{
	int fibarray[45];
	for (int i = 0; i < n; i++)
	{
		fibarray[i] = 0;
	}
	fibarray[0] = 1;
	fibarray[1] = 1;

	for (int i = 2; i <= n; i++)
	{
		fibarray[i] = fibarray[i - 1] + fibarray[i - 2];
	}

	return fibarray[n];
}

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

	cout << fib(n) << endl;

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
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; }

vector<long long> dp(50, -1);
int fib(int x) {
    if(dp[x] != -1) return dp[x];
    if(x == 0 || x == 1) return dp[x] = 1;
    return dp[x] = fib(x-1) + fib(x-2);
}

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

C++: #include<stdio.h>
#define MAX 44

int FN[MAX+1];

int main() {
    int i, n;
    FN[0] = FN[1] = 1;

    scanf("%d", &n);
    for (i=2; i<=n; i++) {
        FN[i] = FN[i-1] + FN[i-2];
    }

    printf("%d\n", FN[n]);

    return 0;
}

C++: #include<iostream>

using namespace std;

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

int main(void){

int n;

while(cin >> n)cout << fib(n) << endl;

return 0;
}

C++: #include <iostream>
using namespace std;
int memo[50];
int fib(int n)
{
	if(n == 0 || n == 1)	
		memo[n] = 1;
	
	if(memo[n] != 0)
	{
		return memo[n];
	}
	else 
	{
		memo[n] = fib(n - 1) + fib(n - 2);
		return memo[n];
	}
}

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

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <numeric>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9000000000000000000;
const double PI = acos(-1);

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

C++: #include<iostream>
#include<vector>

using namespace std;

class Fibonacci{
private:
 vector< long > FN;
 long current;
public:
 Fibonacci( long num_0 = 1, long num_1 = 1, long max = 100 ) : current( 1 ), FN( max, 0 ){
  FN[ 0 ] = num_0;
  FN[ 1 ] = num_1;
 };

 void calculate( long num ){

 while( current < num )
  ++current;
  FN[ current ] = FN[ current-2 ] + FN[ current-1 ];
 };

 long get( long num ){
  if( current < num ) calculate( num );

  return FN[ num ];
 }
};

int main(){
 Fibonacci fn;

 long n = 0; cin >> n;

 cout << fn.get( n ) << endl;

 return 0;
};

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

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