Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3")
- #include <bits/stdc++.h>
- using namespace std;
- //
- #define int long long
- #define double long double
- #define endl '\n'
- #define fastio ios_base::sync_with_stdio(0); cin.tie(0)
- signed main()
- {
- fastio;
- // evvelki 2 ededin cemi 0 1 ile baslayir bezen 1 1 ile baslayir kimi deyilir meselede
- /*
- // n ci fibo ededi tapmaq
- int n;
- cin >> n;
- int f[n + 5];
- f[0] = 0;
- f[1] = 1;
- for(int i = 2; i <= n; i++){
- f[i] = f[i - 1] + f[i - 2];
- }
- cout << f[n] << '\n';
- */
- /*
- // necenci fibo ededidi?
- int n;
- cin >> n;
- int f[105];
- f[0] = 1;
- f[1] = 1;
- for(int i = 2; i <= 90; i++){ // ededler tez tez artir 90 dan o terefe long longdan cox olur
- f[i] = f[i - 1] + f[i - 2];
- if(f[i] == n){
- cout << i << '\n';
- return 0;
- }
- }
- cout << -1; // fibo ededi deyilse
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement