Go: package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)

	fmt.Fprintln(writer, fib(n))
	writer.Flush()

}

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

ll memo[55];

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

int main() {
    fib(50);
    int n;
    cin >> n;
    cout << memo[n] << endl;
}

C++: #include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
int main() {
  int n;
  int dp[44] = {};
  cin >> n;
  dp[1] = dp[0] = 1;

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

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


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

    return fib[n];
}

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

    cout << fibonacci(n) <<endl;

    return 0;
}

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

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

C++: #include <iostream>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define NIL -1
#define MAX 10000

int dp[50];


int fibonacci(int i)
{
    if(i == 0 || i == 1) return dp[i] = 1;
    if (dp[i] != -1) return dp[i];
    return dp[i] = fibonacci(i-1) + fibonacci(i-2);
}

int main()
{
    int n;
    rep(i, 50) dp[i] = -1;

    cin >> n;
    cout << fibonacci(n) << endl;

    return 0;
}

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

void make_fib(vector<int>& fib){
  for(int i=2; i<fib.size(); i++){
    fib[i] = fib[i-1] + fib[i-2];
  }
}

int main(){
  vector<int> fib(50,1);
  make_fib(fib);
  int n; cin >> n;
  cout << fib[n] << "\n";
}

C++: #include <cstdio>

int fibo(int n, int *dp) {
    if (n == 0 || n == 1) return 1;
    if (0 < dp[n]) return dp[n];
    return fibo(n-1, dp) + fibo(n-2, dp);
}

int
main ()
{
    int n;
    int dp[50];
    for (int i=0; i<50; i++) dp[i] = -1;
    scanf("%d", &n);
    printf("%d\n", fibo(n, dp));
    return 0;
}

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>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

#define max 44

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

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

C++: #include<iostream>
using namespace std;
  
typedef long long hyper;
  
hyper fib(int n)
{
    if(n < 2) return 1;
    if(n == 2) return 2;
    if(n == 3) return 3;
    return 3 * fib(n - 2) - fib(n - 4);
}
   
int main()
{
    int n;
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}

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

int fib(int n,int F[]){
	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;
	int F[n];
        for(int i=0;i<n;i++){
              F[i]=-1;
        }
	cout<<fib(n)<<endl;
	
	return 0;
}

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;

}