Go: package main

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

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

// func main(){
// 	sc := bufio.NewScanner(os.Stdin)
// 	sc.Scan()
// 	n, _ := strconv.Atoi(sc.Text())
// 	fmt.Println(fib(n))
// }

import (
	"fmt"
)

func main(){
	var n, pre1, pre2, now int
	fmt.Scan(&n)
	if n == 0 || n == 1{
		fmt.Println(1)
	} else {
		pre1, pre2 = 1, 1
		for i:=1; i<n; i++{
			now = pre1 + pre2
			pre2 = pre1
			pre1 = now
		}
		fmt.Println(now)
	}

}

C++: #include<iostream>

using namespace std;

int fib(int n);

int memo[1000];

int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

int fib(int n){
  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 <cstdio>

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

    return 0;
}

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

using Lint=long long;

int main()
{
   int N; cin>>N;
   vector<int> dp(N+1);
   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<stdio.h>

int A[44];

void fibo(int n){
    A[0] = 1;
    A[1] = 1;
    for(int i=2; i<=n; i++){
        A[i] = A[i-1] + A[i-2]; //メモ化
    }
}

int main(){

    int n;
    scanf("%d", &n);

    fibo(n);
    printf("%d\n", A[n]);
    return 0;
}

C++: #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <stdlib.h>
#include <stdio.h>

using namespace std;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int abs_A(int num) {
    if (num > 0)
        return num;
    else
        return -num;
}

int abs_B(long long num, long long numb) {
    if (num - numb >= 0)
        return num - numb;
    else
        return -1 * (num - numb);
}

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}

long long lcm(long long a, long long b) {
    return a * b / gcd(a, b);
}

bool permutation(vector<int>& vec,vector<int>& P) {
    bool ok = true;
    for (int i = 0; i < vec.size(); i++) {
        //cout << vec.at(i);
        if (vec.at(i) != P.at(i)) {
            ok = false;
        }
    }
    return ok;
}

/*bool nibu(vector<int>& retu,int key) {
    
}*/

const long long MOD = 1000000007;
const int INF = 1001001001;

int main() {
    int N;
    cin >> N;
    vector<int> fib(45);
    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;
}

C++: #include <iostream>

using namespace std;


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

}

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

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

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

    vector<int> dp(n + 1);
    dp[0] = 1; dp[1] = 1;
    for (auto 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;

  return 0;
}

C++: #icnlude <iostream>

using namespace std;

int fib(int n);

int memo[45];

int main(){
  int n;

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

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

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

C++: #include<cstdio>

const int MAX_V = 44;
int fib_array[MAX_V]{0};
void make_fib_array(){
  fib_array[0]=1;
  fib_array[1]=1;
  for(int i=2;i<MAX_V;i++)
    fib_array[i]=fib_array[i-1]+fib_array[i-2];
}
int main(){
  make_fib_array();
  int n; scanf("%d",&n);
  printf("%d\n",fib_array[n]);
}

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;
int f[50];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int n;cin>>n;
	f[0]=f[1]=1;
	REP(i,n-1){
		f[i+2] = f[i + 1] + f[i];
	}
	cout << f[n] << endl;
  return 0;
}

C++: #include <stdio.h>
int main()
{
    int x;
    int f[100];
    f[0]=f[1]=1;
    scanf("%d",&x);
    for(int i=2;i<=x;i++){
      f[i]=f[i-1]+f[i-2];
    }
    printf("%d",f[x]);
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <cstring>

#define LP(i,n) for(int i=0;i<n;i++)
#define Mset(x,v) memset(x,v,sizeof(x))

using namespace std;
using LL=long long;

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 <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)

vector<int> dp(50,-1);

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

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

C++: #include <iostream>

using namespace std;

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

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
ll fib[50];
ll dfs(int n) {
    if (fib[n] > 0) return fib[n];
    if (n == 0 || n == 1) return 1;
    return fib[n] = dfs(n-1) + dfs(n-2);
}
int main(void) {
    int n;
    cin >> n;
    cout << dfs(n) << endl;
    return 0;
}