Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7606 - Фибоначчийн n дахь гишүүн

F1=1, F2=1, Fn=Fn-1+Fn-2 томьёо өгөгдсөн бол n-р гишүүнийг ол.

Input

Натурал тоо өгөгдөнө. 1<=n<=45.

Output

Fn

Example

Input:

3

Output:

2


Нэмсэн:Bataa
Огноо:2013-01-24
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2022-05-26 02:21:54
EZZZZZ
2022-05-26 02:21:53
EZZZZZ
2022-05-26 02:21:46
EZEZ

2021-09-29 12:59:30
// #include <iostream>
// using namespace std;

// int nani(int n){
// if(n <= 2) return 1;
// else return nani(n-1) + nani(n-2);
// }

// int main() {

// int n;
// cin >> n;

// cout << nani(n);
// return 0;
// }
2020-11-08 02:37:05
ez ym bol bodlogoo yvuulaach
2020-11-07 05:09:26
#incluasdgde<cstdio>
int mgdasdgain() {asdgaeg
ingadsast a[asgas50],n;gasas
a[1]=1;
a[2]=1;
scanf("%d",&n);
for(int i=3;i<=n;i++){
a[i]=a[i-1]+a[i-2];
}asdsgadsfg
asdgsadgprintf("%d",sdggasga[n]);
} dfgfdg
2019-11-10 04:54:52
#include<bits/stdc++.h>
using namespace std;
int main() {
int n , i ;
int prev_1, prev_2, current;
cin >> n ;
i = 3 ;
if ( n < 3 )
cout << 1 << endl;
else {
prev_1 = 1;
prev_2 = 1;
while ( i <= n ) {
current = prev_1 + prev_2;
prev_1 = prev_2;
prev_2 = current;
i++;
}
cout << current << endl;
}
return 0;
}
2019-10-29 05:03:12
#include<bits/stdc++.h>
using namespace std;
int main() {
int n , i ;
int prev_1, prev_2, current;
cin >> n ;
i = 3 ;
if ( n < 3 )
cout << 1 << endl;
else {
prev_1 = 1;
prev_2 = 1;
while ( i <= n ) {
current = prev_1 + prev_2;
prev_1 = prev_2;
prev_2 = current;
i++;
}
cout << current << endl;
}
return 0;
}




xaxa ez biluu


Last edit: 2019-10-29 05:04:03
2019-10-28 12:08:14
ez
2019-10-20 10:35:50
dogii ass hole
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.