Go: package main

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

//util
var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

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){
  /* ??????1 */
  if(n==0||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;



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

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

int dp[50];

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

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

C++: // 

// g++ -std=c++11 abc145_c.cc && ./a.out 
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;


int memo[50];
int n;

int fibo(int i) {
    if (memo[i] != 0) { return memo[i]; }

    int result = fibo(i - 1) + fibo(i - 2);
    memo[i] = result;
    return result;
}

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

    rep(i, n) memo[i] = 0;
    memo[0] = 1;
    memo[1] = 1;

    cout << fibo(n) << endl;

    return 0;
}

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){
  int dp[1000];
  dp[0] = 1;
  dp[1] = 1;

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

C++: #include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define all(v) (v).begin(),(v).end()
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int f[50]={};

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

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

  return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <cstring>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

using namespace std;

const int N_MAX = 1000000;
int dp[N_MAX];


int fib(int n, int* dp){
  if(n==0) dp[n] = 1;
  if(n==1) dp[n] = 1;

  if(dp[n] >= 0) return dp[n];
  else dp[n] = fib(n-2, dp) + fib(n-1, dp);
  return dp[n];
}

int main(){
  int n;
  cin >> n;
  memset(dp, -1, N_MAX * sizeof(dp[0]));
  cout << fib(n, dp) << endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
#define n 44
int F[n],Fl[n];
int fibonacci(int na)
{
    if( na == 1 || na == 2)
        return F[na] = 1;
    if(F[na])
        return F[na];
    return F[na] = fibonacci(na - 1) +fibonacci(na - 2 ) ;
}

void makeFibonacci()
{
    Fl[1] = Fl[0] = 1;
    for(int i=2;i<=n;i++)
    {
        Fl[i] = Fl[i-1] + Fl[i-2];
    }
}

int main()
{
    int na;
    cin>>na;
    //cout<<fibonacci(na)%10007<<endl;
    makeFibonacci();
    cout<<Fl[na]<<endl;
    return 0;
}

C++: #include<stdio.h>

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

C++: #include <cstdio>

using namespace std;

int sum = 0;

int fib( int n ){

    if( n >= 0) {

        if( n == 0 || n == 1 ){

            return 1;

        } else {

            sum = fib( n - 1 ) + fib( n - 2 );        

        }

    } else return 0;

    return sum;

}

int main(){

    int n;

    scanf("%d", &n);

    int ans = fib(n);

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

}

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

int Fib(int n){
	double phi = (1+sqrt(5))/2;
	return floor(pow(phi,n)/sqrt(5) + 0.5 );
}

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

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define  all(x) (x).begin(),(x).end()
typedef long long ll;

int f[45];

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

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

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

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

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