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>
#include <algorithm> // next_permutation
#include <iomanip>
#include <cmath>
#include <vector>
#include <sstream>
#include <string>
#include <cstdio>
#include <stack>
#include <queue>
#include <list>
#include <numeric> //accumulate
//#include <unordered_map> //???????????\??¢??°
#include <fstream> //ifstream, ofstream

//#define NDEBUG //NDEBUG???#include <cassert>???????????????????????????????????´???assert?????????????????????????????????NDEBUG?????????????????????????????????????????????
#include <cassert> //assert


using namespace std;

//???????????°??????TEST????????????????????¬???????????????????????????????????¢????????????
#define TEST //*******************************************************************************************************************************************
//?????????????????¨??§?????\????????????????????????????????°?????????????¨???????????????????dout???????????????????????§???????????¬??????????????????????????????????????????
//??????????????????????????????????????????????????????????§?CPU???????£??????????????????§???TLE?????????????????????????????????????????§????????¨???                           ????????????????????????cerr????????£????????????????????????????????????
#ifdef TEST
#define dout cout
#define din cin
#else
stringstream dummy; //???????????°??????dout?????????????????????????????????
#define dout dummy.str(""); dummy.clear(stringstream::goodbit); dummy //dummy?????????????????????????????????????????¨?????¢?????¢???????????????
//???????????¨??????????????????goodbit?????????????????????????????¨???????????´????????????????????????????????¨?????°?????????????????§???????????????????????????????????? http://d.hatena.ne.jp/linden/20060427/p1
#endif

//?¨??????????????????????????????????????????????????????´??????OUTPUTFILE????????????????????¬???????????????????????????????????¢????????????
//#define OUTPUTFILE "output.txt" //*******************************************************************************************************************************************
#ifdef OUTPUTFILE
#define dout outputfile //??¨????????????TLE????????§?????????dout?????¨??¨??????????????¢????????????????????????????????????????????§????¨????????????´??????????????£??????????????????????¨?????????????????????????????????????????????§?????????????????????
ofstream outputfile(OUTPUTFILE);
#define OutputFilePath "/Users/Nag/Documents/Prgm/Test/DerivedData/Test/Build/Products/Debug/output.txt"
#endif

//?¨??????\???????????????????????????????????????????????´??????INPUTFROMTEXTFILE????????????????????¬???????????????????????????????????¢????????????
//#define INPUTFILE "input.txt" //*******************************************************************************************************************************************
#ifdef INPUTFILE
#define din inputfile
ifstream inputfile(INPUTFILE);
#endif


#define disp(A) dout << #A << " = " << (A) << endl
#define disP(A) dout << setw(3) << (A) << " " // << setw(3) ??????????????\????????????
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)

#define dispAll(A,n) dout << #A << " = "; rep(j, 0, (n)) {disP(A[j]);} dout << endl

typedef pair<int,int> pii;
typedef vector<int> vi;
typedef unsigned long long ll;

const int INF = 1e9-1;

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


int main() {
    int n; cin >> n;
    
    dout << fibonacci(n) << endl;
    
    
    
#ifdef INPUTFILE
    inputfile.close();
#endif
    
#ifdef OUTPUTFILE
    outputfile.close();
    cout << "\"" << OutputFilePath << "\"" << endl;
#endif
    
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	int a = 1;
	int b = 1;
	for(int i=1; i<n;++i){
		int t = b;
		b = a + b;
		a = t;
	}
	cout << b << std::endl;
}

C++: #include <iostream>

using namespace std;

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

	int fib[100]={0};

	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 <iostream>
#include <unordered_map>
using namespace std;

unordered_map<int,int> memo;
int fib(int n){
    if(n<2) return 1;
    if (not memo.count(n)) memo[n] = fib(n-1)+fib(n-2);
    return memo[n];

}

int main(void){cin.tie(0);ios::sync_with_stdio(false);
    int n; cin>>n;
    cout<<fib(n)<<"\n";
}

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

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

C++: #include "iostream"
#include "algorithm"
#include "string"
using namespace std;

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

C++: #include <stdio.h>
#define MAX 45

int F[MAX];

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

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

C++: #include <cstdio>

int fib(int *a,int n){
    if(n==0 || n==1)return 1;
    else{
        int tmp;
        if(a[n])tmp = a[n];
        else{
            tmp = fib(a,n-1) + fib(a,n-2);
            a[n] = tmp;
        }
        return tmp;
    }
}

int main(){
    int i, n;
    int a[45];
    for(i=0;i<45;i++)a[i]=0;
    scanf("%d",&n);
    printf("%d\n",fib(a,n));
    return 0;
}

C++: #include<iostream>

using namespace std;

int fib(int n);

int memo[45];

int main() {
  int n;

  //入力
  cin >> n;

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

  return 0;
}

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 fib(n-1) + fib(n-2);
  }
}

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

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

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

C++: #include<bits/stdc++.h>
#define ll long long
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
const ll MOD = (ll)1e9+7;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
} 

ll fibonacci(int x){
	if(x<=1)return 1;
	static vector<ll> memo(45, -1);
	if(memo[x]>=0)return memo[x];
	return memo[x] = fibonacci(x-1) + fibonacci(x-2);
}

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