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 f[46]={0};

int fib(int n){
    f[0] = 1;
    f[1] = 1;
    for(int i=2; i<46; i++)    f[i] = f[i-1]+f[i-2];

    return f[n];
}

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

C++: #include <iostream>
using namespace std;
int fib(int n) 
{
	if (n >= 0) {
		if (n <= 1) return 1;
		return fib(n - 1) + fib(n - 2);
	}
}
int main(void)
{
	int n;
	scanf_s("%d", &n);
	printf("%d", fib(n));
}

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

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

int main(){
    int n;
    int dp[50];
    memset(dp,-1,sizeof(dp));

    scanf("%d",&n);
    printf("%d\n",fib(dp,n));
}

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

int fib(int n){

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

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

  cout << fib(n) << endl;; 

  return 0;

}

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

#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define ALL( a )        (a).begin(), (a).end()             

int main() {
	int n; cin >> n;
	int dp[50];
	dp[0] = dp[1] = 1;

	FOR( i, 2, n + 1 ) dp[i] = dp[i - 1] + dp[i - 2];

	cout << dp[n] << endl;
}

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

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

C++: #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using P = pair<int,int>;
const int inf = 1e8;

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

C++:     #include <bits/stdc++.h>
    #define rep(i,n) for(int i = 0; i < (n); i++)
     
    using namespace std;
    
    int main() {
   
    int n;
    scanf("%d",&n);
    int ans = 0;
    int second = 0;
    for(int i = 0; i <= n; i++){
    	if(i == 0 || i == 1){	ans = 1;
    	} else{
    		if(i == 2){
    			second = 1;
    		    ans = 1;
    		}
    		int t = second;
    		second = ans;
    		ans = ans + t;
    	}
    }
    	printf("%d\n",ans);
    
     return 0;
    }

C++: #include <bits/stdc++.h>
using namespace std;
int a[45];
int fib(int n)
{
    if(a[n]>0)
        return a[n];
    return a[n]=fib(n-2)+fib(n-1);
}
int main()
{
    a[1]=a[0]=1;
    int n;
    cin>>n;
    cout<<fib(n)<<endl;
    return 0;
}

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

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int dp[50];
int main(){
	int n;
	cin>>n;
	dp[0]=1,dp[1]=1;
	for(int i=2;i<=n;i++)dp[i]=dp[i-1]+dp[i-2];
	cout<<dp[n]<<endl;
	return 0;
}

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'

//DP法
template <class T>
inline bool chmin(T &a, T b) //change minimum
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b) //change max
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

typedef long long ll; //64bit型
using namespace std;

const long long INF = 1LL << 60; //無限大の値
int N;
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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
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 ll INF = 1LL << 60;
const int MAX = 1000000010;
const ll MOD = 1000000007;
const double PI = acos(-1);

int main() {
    int N; cin >> N;
    vector<int> fib(N + 1);
    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;
    return 0;
}

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

int f[50];

int fibo(int n)
{
  if(n <= 1) return 1;
  return f[n] = fibo(n-1)+fibo(n-2);
}

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

  cout << fibo(n) << endl;
  return 0;
}

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

C++: #include <iostream>
using namespace std;
int F[100];
int Fibonacci(int N) {
  F[0] = 1;
  F[1] = 1;

  for (int i = 2; i <= N; ++i) {
    F[i] = F[i-2] + F[i-1];
  }
  return F[N];
}
int main() {


  int N;
  cin >> N;
  cout << Fibonacci(N)<<endl;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define FOR(i,a,b) for(int (i)=(a);i<(n);++(i))
#define ALL(obj) (obj).begin(),(obj).end()
#define space <<" "<<
using namespace std;

    vector<long> dp;

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

int main(){

    int n;
    cin>>n;

    dp.assign(n+1,-1);
    cout <<fib(n)<< endl;
   
}

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

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	ll n, f[50] = {0};
  cin >> 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;
}

C++: #include <stdio.h>

int fib(int);

int main()
{
  int n,total=0;

  scanf("%d",&n);

  total=fib(n);

  printf("%d\n",total);

 
  return 0;
}    


int fib(int n){

  static int total=0;

  if(n==0) return ++total;
  else if (n==1) total++;
  else fib(n-1)+fib(n-2);
}

C++: #include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include<cstdio>
#include <vector>
#include<queue>
#include<limits.h>
#include<string.h>
#include<functional>
#include<map>
#include<set>
#include<list>
#include<unordered_map>
#include<queue>
#define int long long
using namespace std;

signed main(){
	int a; cin >> a;
	int b = 0, c = 1;
	for (int d = 0; d < a; d++) {
		int e = b + c;
		b = c;
		c = e;
	}
	cout << c << endl;
}