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>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

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

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];
	return 0;
}

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

int f[45] = {};

int fib(int n);

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

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

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

int Fibonacci(const int& n)
{
	int TwicePreviousValue = 1;
	int PreviousValue = 1;
	if(n == 0) return TwicePreviousValue;
	if(n == 1) return PreviousValue;
	int CurrentValue = TwicePreviousValue + PreviousValue;
	for(int i = 2; i < n; i++){
		CurrentValue  += PreviousValue;
		PreviousValue += TwicePreviousValue;
		TwicePreviousValue = PreviousValue - TwicePreviousValue;
	}
	return CurrentValue;
}

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

C++: 

#include<stdio.h>
#include<sys/time.h>
static double gettime(){
	struct timeval tv ={0};
	gettime(&tv,NULL);
	return(tv,tv-sec*1000.0)+(tv.tv_usec/1000.0);
}

long long fibo(int n){
	long long fibodp[200];
	fibodp[0]=1;
	fibodp[1]=1;
	for(int i=2; i<=n,i++){
		fibodp[n]=fibodp[n-1]+fibodp[n-2];
	}
	return fibodp[n];
}

 int main(void){
	for(int i=s; i<=41; i++){
	double s=gettime();
	long long res =fibodp(i);
	double e=gettime();
	printf("fibo(%d)=%ld %f\n",i,res,(e-s));

return(0);
}

C++: #include <stdlib.h>
#include <stdio.h>

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

int main(){

int x,n;
scanf("%d",&n);
x=fib(n);
printf("%d",x);

return 0;
}

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

long long int fib(int, long long int*);
int main(){
  int n; cin >> n;
  long long int fibarray[n+1];
  for(int i=0; i<=n; i++) fibarray[i]=-1;
  cout << fib(n, fibarray) << endl;

  return 0;
}

long long int fib(int n, long long int* array){
  if(array[n]>0) return array[n];
  if(n==0 || n==1){
    return array[n]=1;
  }
  else return fib(n-1, array)+fib(n-2, array);
}

C++: require 'matrix'

def fib(n)
  a = Matrix[[1, 1], [1, 0]]
  return (a**(n+1))[1, 0]
end

puts fib(gets.to_i)

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) {
	if (n == 0 || n == 1)return 1;
	else return fib(n - 1) + fib(n - 2);
}

C++: #define PI 3.14159265359
#define INF 2000000000
#define MAX 500000
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
typedef long long ll;

ll F[45]={0};

ll fibo(int n){
    if(n==0||n==1) return F[n]=1;
    if(F[n]) return F[n];
    else return fibo(n-1)+fibo(n-2);
}

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

C++: #include <iostream>

using namespace std;

int dp[100];
int n;

int main(void){

  dp[1] = dp[0] = 1;
  cin >> n;

  for( int i = 2 ; i <= n ; 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;
}

C++: /*
 * C言語のサンプルプログラム - Webkaru
 * - フィボナッチ数の計算 -
 */
#include <stdio.h>
 
int main(void)
{
  /* 変数の宣言 */
  int n;
  int f0, f1, f2;
 
  f0 = 0;
  f1 = 1;
  scanf("%d",&n);
 
  /* フィボナッチ数の計算 */
  while(f1<100000) {
    // フィボナッチ数の計算
    f2 = f1 + f0;
    if(f0==n)printf("%d\n",f2);
    // 変数の代入
    f0 = f1;
    f1 = f2;
  }
 
  return 0;
}

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 + 1];

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)
    {
        return 1;
    }

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

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
typedef long double ld;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1000000009;

ll fib[50];

void solve(){

    int n;
    cin >> n;
    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;

}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}

C++: #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
ll func(int at,V &dp){
    if(dp[at]==-1){
        dp[at]=func(at-1,dp)+func(at-2,dp);
    }
    return dp[at];
}
int main(){
    int n;
    cin >> n;
    vector<ll>dp(n+3,-1);  
    dp[0]=1LL;
    dp[1]=1LL;

    cout << func(n, dp)<< endl;
}