Go: package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

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

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<vector>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
const long long mod = 1e9 + 7;

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

C++: #include <iostream>

using namespace std;

int memo[100];

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

int main() {
    int n;
    cin >> n;
    fill(memo, memo + n, -1);
    cout << fibonacci(n) << endl;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------


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++: #define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <list>

long long int INF = 1e18;
using namespace std;

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

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

C++: #define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<iomanip>
#include<set>
#include<map>
#include<utility>
#include<string>
#include<vector>

using namespace std;

#define LL long long

LL n,fib[50];

int main() {
	cin>>n;
	for(int i=0;i<=n;i++){
		if(i==0||i==1)fib[i]=1;
		else fib[i]=fib[i-1]+fib[i-2];
	}
	cout<<fib[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;

	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
typedef long long int ll;
ll Dp[50];
int main()
{
for(int i=2;i<50;i++)Dp[i]=Dp[i-1]+Dp[i-2];
int N;
cin >> N;
cout << Dp[N] << "\n";

return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
typedef long long ll;

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

C++: #include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;

int n,a[55];

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

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
//using ll = long long;
//using P = pair<int, int>;
 
int fib[50];

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

C++: #include <iostream>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < n; ++i)

int main() {
  int N; cin >> N;
  int dp[45];
  dp[0] = dp[1] = 1;
  rep(i, 1, N) dp[i + 1] = dp[i] + dp[i - 1];
  cout << dp[N] << endl;
  return 0;
}

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

//短縮
#define rep(i,n) for(int i=0;i<(n);++i)
//sort()用
#define all(v) v.begin(), v.end()

using namespace std;

using Graph = vector<vector<int>>;

int main(){
  int n;
  cin >> n;
  int n1=1,n2=1;
  vector<int> fib(n+1);
  fib.at(0)=1;
  fib.at(1)=1;
  for(int i=2;i<=n;i++){
    fib.at(i)=fib.at(i-1)+fib.at(i-2);
  }
  cout << fib.at(n)<< endl;
  return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <utility>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

int f[45] = {};

int fib(int i)
{
    if (f[i] > 0)
        return f[i];

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

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

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

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

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A
// Dynamic Programming - Fibonacci Number

#define SUBMIT

#include <utility>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <limits>
#include <numeric>
#include <functional>
#include <set>
#include <cmath>
#include <cstring>
#include <climits>
#include <memory>

using namespace std;
using ui64 = unsigned long long;
using i64 = long long;

const ui64 MAX_N = 44;
int dp[MAX_N + 1];

int main() {
    // initialize
    memset(dp, 0, sizeof(dp));
    dp[0] = 1, dp[1] = 1;

    for (int i = 2; i <= MAX_N; ++i) dp[i] = dp[i - 1] + dp[i - 2];

    int n;
    cin >> n;

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