Advertisement
andreisophie

NumarDeSubmultimi#3213

Nov 12th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #define mod 777013
  3.  
  4. using namespace std;
  5.  
  6. int n,f1=1,f2=1;
  7.  
  8. void fibo()
  9. {
  10.     int sum;
  11.     for (int i=1;i<=n;i++)
  12.     {
  13.         sum=(f1+f2)%mod;
  14.         f1=f2;
  15.         f2=sum;
  16.     }
  17.     cout<<f2-1;
  18. }
  19.  
  20. int main()
  21. {
  22.     cin>>n;
  23.     fibo();
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement