Go: package main

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

func fib(n int) int {
	x, y := 1, 1
	for n > 0 {
		x, y = y, x+y
		n--
	}
	return x
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n, err := nextInt(sc)
	if err != nil {
		panic(err)
	}
	fmt.Println(fib(n))
}

func nextText(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func nextInt(sc *bufio.Scanner) (int, error) {
	return strconv.Atoi(nextText(sc))
}

C++: #include <iostream>

using namespace std;

int fibdp[50];

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

	cin >> n;

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

C++: #include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

#define MAX 200000
#define INFTY 1<<30

using namespace std;

int main()
{
  int n; cin >> n;
  int F[MAX];
  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 <stdio.h>

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

C++: #include <bits/stdc++.h>
using namespace std;
#define MAX_N 10000
int dp[MAX_N];
int fib(int n){
    dp[0]=1;
    dp[1]=1;
    for(int i=2;i<=n;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[n];
}
int main(){
    int n;
    cin>>n;
    int ans=fib(n);
    cout<<ans<<endl;
    return 0;
}

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

int makeFibonacci(int n) {
	int a[100];
	a[0] = 1;
	a[1] = 1;

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

	return a[n-1];
}


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

	int ans = makeFibonacci(n);

	cout << ans << endl;

	return 0;

}

C++: #include<iostream>
using namespace std;
int main() {
	int F[45];
	F[0] = 1;
	F[1] = 1;
	int n;
	cin >> n;
	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 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++: #include<iostream>
using namespace std;

typedef long long int lli;

lli nlist[50];

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

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

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

  int F[45];
  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 <vector>
#include <iostream>
using namespace std;
typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long ll;
//A*Bの計算
mat mul(mat &A,mat &B){
	mat C(A.size(),vec(B[0].size()));
	for(int i =0;i <A.size();i++){
		for(int k =0;k <B.size();k++){
			for(int j =0;j <B[0].size();j++){
				C[i][j] =(C[i][j]+A[i][k]*B[k][j]);
			}
		}
	}
	return C;
}

//A^nの計算
mat pow(mat A,ll n){
	mat B(A.size(),vec(A.size()));
	for(int i =0;i <A.size();i++){
		B[i][i]=1;
	}
	while(n >0){
		if(n&1)B =mul(B,A);
		A =mul(A,A);
		n >>=1;
	}
	return B;
}


int main(){
	int n;
	cin>>n;
	mat A(2,vec(2));
	A[0][0]=1;
	A[0][1]=1;
	A[1][0]=1;
	A[1][1]=0;
	A =pow(A,n+1);
	cout <<A[1][0]<<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 <bits/stdc++.h>
using namespace std;

int dp[50];

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

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

C++: #include <cstdio>

const int MAX = 45;

int fib_num[MAX];

int fib(int n)
{
  if (fib_num[n] != 1)
    return fib_num[n];

  if (n == 0 || n == 1)
    return 1;
  else
    return fib_num[n] = fib(n - 1) + fib(n - 2);
}

int main()
{
  for (int i = 0; i < MAX; ++i)
    fib_num[i] = 1;

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

  return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ld> vd;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll, ll>> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); i++)
#define FI first
#define SE second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define TS to_string
#define NP next_permutation
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) (ll) x.size()
#define SP(x) setprecision((ll)x)


ll INF = 1e9;
ll NIL = -1;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "yes" << endl;}
void no(){ cout << "no" << endl;}

//-----------------------------------------

//-----------------------------------------
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin >> n;
  vll fib(100);
  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 main(){
	int n, F[45];
	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;
	
	return 0;
}