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

using namespace std;

int main(void){

int n,fib[45];
fib[0]=fib[1]=1;

for(int i=2;i<45;i++)fib[i]=fib[i-1]+fib[i-2];

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

return 0;
}

C++: #include<iostream>

using namespace std;
int fib(int n);

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

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

C++: // フィボナッチ数列
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<vector>

using namespace std;

#define MAX_N 44
// 無効な値の定義
const int INV = -1;

// フィボナッチ数列を保持する配列
int fib[MAX_N];

int Fibonacci(int n);

int main(void)
{

    int n;

    cin >> n;

    for(int i = 0; i < MAX_N; i++)
    {
        fib[i] = INV;
    }

    fib[0] = 1;
    fib[1] = 1;

    // フィボナッチ数列の表示
    printf("%d\n", Fibonacci(n));

    return 0;
}

// フィボナッチ数列を算出する関数
int Fibonacci(int n)
{
    if( n <= 1)
    {
        // n = 0, n = 1 の時
        return 1;
    }

    if( fib[n] != INV )
    {
        // 既に計算されている時は, 結果を返す
        return fib[n];
    }

    return Fibonacci(n - 1) + Fibonacci(n - 2);
}

C++: # include <bits/stdc++.h>
# define range_for(i, b, e) for(int i=(b), i##_len=(e); i<i##_len; ++i)
using namespace std;
void _cin(){}
template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
#define Cin(Type, ...) Type __VA_ARGS__; _cin(__VA_ARGS__)

static const int n_max = 44;
int fib[n_max + 1];

int main()
{
    Cin(int, n);

    fib[0] = fib[1] = 1;
    range_for (i, 2, n+1)
    {
        fib[i] = fib[i-1] + fib[i-2];
    }

    cout << fib[n] << endl;

    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main ()
{
  long long int a[45];
  a[0]= 1;
  a[1] = 1;
  for(int i = 2;i<=44;i++)
     a[i] = a[i-1]+a[i-2];
  int n;
  scanf("%d",&n);
  printf("%lld\n",a[n]);
  return 0 ;
}

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

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

}

C++: #include<iostream>

using namespace std;
int fib(int n);

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

int bib(int n){

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

  }

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

vector<int> dp(50,-1);

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

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a[45],n;
  cin >> n;
  a[0] = 1;
  a[1] = 1;
  if (n < 2){
    cout << a[n] << endl;
  }
  else{
    for (int i=3; i<=n; i++)
      a[i] = a[i-1] + a[i-2];
    cout << a[n] << endl;
  }
}

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

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

}

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

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

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

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

int main(){

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

    int n; cin >> n;
    cout << fib[n] << endl;
    return 0;
}