Go: package main

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

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

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


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

    cin >> num;
    int array[num] = {};
    fib(num, array);


}

C++: #include <iostream>
using namespace std;
int F[100];
int main() 
{
int n;
F[0] = 1;
F[1] = 1;
for (int i=2; i<45; ++i) 
{ // ???????????????
F[i] = F[i-2]+F[i-1];
}
cin>>n;
cout<<F[n];
}

C++: /*
** 本题使用两个stack，一个用来统计总积水，一个用来统计单独的积水面积。
*/

# include <cstdio>
# include <stack>
# include <vector>
using namespace std;

static const int maxn = 20000 + 10;

char buff[maxn];

int main() {
	// freopen("data.in", "r", stdin);
	// freopen("data.out", "w", stdout);
	while (scanf("%s", buff) != EOF) {
		/*
		** ts用来存储每一个'\'字符的位置，然后当出现'/'字符的时候，通过距离计算积水面积
		** ps用来存储每一个'\'所对应的积水面积，默认是0，当出现'/'后，再把面积加进去
		*/
		stack <int> ts, ps;
		int sum = 0;
		for (int i = 0; buff[i] != '\0'; i++) {
			if (buff[i] == 92) { // 92 是 '\'的 ascii码值
				ts.push(i);
				ps.push(0);
			}
			else if (buff[i] == 47 && !ts.empty()) { // 47 是 '/'的 ascii码值
				int s = i - ts.top(); ts.pop();
				sum += s;
				while (ps.top() != 0) { // 找到相对应的'\'，同时累加中间的积水面积
					s += ps.top();
					ps.pop();
				}
				ps.top() += s;
			}
		}
		
		printf("%d\n", sum);
		vector <int> v;
		while (!ps.empty()) {
			if (ps.top() != 0)
				v.push_back(ps.top());
			ps.pop();
		}
		if (v.size() == 0) // 针对积水面积为0的情况
			printf("0\n");
		else {
			printf("%d ", v.size());
			for (int i = v.size()-1; i > 0; i--)
				printf("%d ", v[i]);
			printf("%d\n", v[0]);
		}
	}
	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 <vector>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define VIEW(dat) for(auto v : dat){cout<<v<<endl;}

int dat[45];
int count;
int fib(int n){
	if(n<2){
		return 1;
	}else{
		if(dat[n]) return dat[n];
		dat[n]=fib(n-1)+fib(n-2);
		return dat[n];
	}
}

int main(){
	count=0;
	rep(i,45) dat[i]=0;	
	int n;
	cin>>n;
	cout<<fib(n)<<endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n;  cin >> n;
    int *dp = new int[n+1];
    dp[0] = 1, dp[1] = 1;

    for (int i = 0; i + 2 <= n; i++)
        dp[i+2] = dp[i+1] + dp[i];

    cout << dp[n] << endl;

    return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <vector>
#include <map>
#include <cstring>
#include <cstdio>
#include <cmath>

using namespace std;

int f(const int);

int main()
{
    int N;
    cin>>N;
    cout<<f(N)<<endl;
}
int f(const int d)
{
    if(d<2)return 1;
    return f(d-1)+f(d-2);
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main() {
  int n; cin >> n;
  vector<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 <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

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

C++: #include <iostream>

using namespace std;

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

C++: #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ld long double
#define INF 1000000000000000000
typedef pair<ll, ll> pll;

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

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

    int N;
    cin >> N;
    memset(F, -1, sizeof(F));
    cout << fibonacchi(N) << endl;

    return 0;
}

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

using namespace std;

#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)

#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))

typedef long long ll;
typedef pair<int, int> PII;

const double EPS = 1e-10;

const int N = 44;
int n;
int dp[N+1];

//???????£?
//recursive function(with/without memo)

int fib(int k) {
  if (dp[k]) return dp[k];
  return fib(k-1) + fib(k-2);
}

int main() {
  memset(dp, 0, sizeof(dp));
  dp[0] = dp[1] = 1;
  scanf("%d ", &n);
  printf("%d\n", fib(n));

	return 0;
}

C++: #define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


int fib(int n){
  
    if(n == 0 || n == 1){
        return 1;
    }
    
    int ans = 0;
    int fib_1, fib_2;
    fib_1 = 1;
    fib_2 = 1;
    
    for(int i = 2; i <= n; i++){
        ans = fib_1 + fib_2;
        fib_2 = fib_1;
        fib_1 = ans;
    }
    
    return ans;
}


int main(int argc, const char * argv[]) {
    
    //Input
    int n;
    scanf("%d", &n);
    
    printf("%d\n", fib(n));
           
    return 0;
}