Go: package main

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

const max int = 44
var ans []int = make([]int, max+1)

func generateFib() {
	ans[0] = 1
	ans[1] = 1
	for i:=2; i<=max; i++ {
		ans[i] = ans[i-1] + ans[i-2]
	}
}

func nextInt(scanner *bufio.Scanner) int {
	scanner.Scan()
	num, _ := strconv.Atoi(scanner.Text())
	return num
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	i := nextInt(scanner)
	generateFib()
	fmt.Printf("%d\n", ans[i])
}

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

using namespace std;

/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++)  //a~(b - 1)?????§
#define all(i) (i).begin(),(i).end() //??¨??????(sort??¨???)
#define mp make_pair //mp(OO, OO)??¨???:::pint??¨???

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;
/*-------------------------------*/

int main(void)
{
  int n; cin >> n;
  int dp[45] = {};
  dp[0] = 1; dp[1] = 1;

  FOR(i, 2, 45){
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[n] << endl;
  return 0;
}

C++: #include <iostream>

int fibs[50] = {1, 1};

int fib(int n)
{
	if (n == 0 || n == 1) return fibs[n];
	if (fibs[n]) return fibs[n];
	return fibs[n] = fib(n - 1) + fib(n - 2);    // pay attension to here.
}

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

	return 0;
}

C++: #include <iostream>

using namespace std;

int fib(int n);
int fib_rec(int n, int dp[]);

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


int fib(int n)
{
	//亦可采用静态数组 
	int * dp = new int[n+1]();
	
	int result = fib_rec(n, dp);	
	
	delete [] dp;
	
	return result;	
	
}


int fib_rec(int n, int dp[])
{

	if (n == 1 || n == 0)
		return dp[n] = 1;
	if (dp[n] != 0)
		return dp[n];
	return dp[n] = fib_rec(n-1, dp) + fib_rec(n-2, dp);
}

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

int main(void) {

  int Fi[64];
  int n;

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

  std::cout << Fi[n] << std::endl;

  return 0;
}

C++: // lcmとかはg++ -std=c++17 default.cppみたいなかんじで
//vector<vector<ll>> piyo(tate,vector<ll> (yoko));

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1000000000
#define ll long long
#define ln cout<<endl;
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define double long double
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
ll target;
bool my_compare(pair<string, ll> a, pair<string , ll> b) {
    // 基本はfirstで比較
    if(a.first != b.first){
         return a.first < b.first; // 昇順
        //return a.first > b.first; // 降順
    }

    // それ以外はsecondで比較
    if(a.second != b.second){
        return a.second > b.second;
    }else{
        // どちらも同じ
        return true;
    }
}

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    //double mini=INF;
    ll maxi=0,f=0,sum=0,mini=INF;
    string str,str1,str2;
    ll i;
    double h;
    ll n,x,m;
    ll a,b,d,c;
    cin>>n;
    ll dp[50];
    dp[0]=1;
    dp[1]=1;
    for(i=2;i<46;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    cout<<dp[n]<<endl;

    return 0;
}

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

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 <iostream>

using namespace std;

unsigned long long dp[50] = {0};

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

}

int main(){
  int n;

  cin >> n;

  cout << fib(n) << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

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

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

typedef long long ll;


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


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cout << fib(n) << endl;
}

C++: #include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#define INF 100000000000000
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//Insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

//大文字から小文字へんかん
//w[i] = w[i]-'A'+'a';

//vector
//assignメソッド　引数：サイズ、値
//与えられたサイズと値でvectorを初期化する

llong fib(llong n, vector<llong> &dp){
    if(dp[n]!=0){
        return dp[n];
    }
    if(n==1 || n==0){
        return 1;
    }
    
    return dp[n]=fib(n-1, dp)+fib(n-2, dp);
}

int main(){
    vector<llong> dp(1000, 0);
    llong n;
    cin >> n;
    cout << fib(n, dp) << endl; 
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define int long long
#define P pair<int,int>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define endl '\n'

int fibo[50];

signed main() {
    int n;
    cin >> n;
    memset(fibo,0,sizeof(fibo));
    fibo[0] = 1;
    fibo[1] = 1;
    for(int i = 2; i <= n; i++){
        fibo[i] = fibo[i-1] + fibo[i-2];
    }
    cout << fibo[n] << endl;
}

C++: #include <iostream>
#include <string>
#include <algorithm> 
#include <cstdlib>
#include <map>
#include <queue>
#include <vector>
#define ll long long
using namespace std;
int calc(int n){
    if(n == 0 ){
            return 1;
    }else if(n==1){
        return 1;
    }else{
        return calc(n-1)+calc(n-2);
        return n;
    } 
}
int main(){
    int a;
    cin >> a;
    cout << calc(a) << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <stack>
#include <string>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <list>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <map>
#define INFTY (1<<30)

using namespace std;

int main(){
	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>
using namespace std;
int main()
{
    int a[100000];
    a[1]=1;a[2]=2;
    int n;cin>>n;
    for(int i=3;i<=n;i++)
    {
        a[i]=a[i-1]+a[i-2];
    }
    cout<<a[n]<<endl;
    return 0;
}

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

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

	int a[44];
	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;
}