Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a,b,c,d,e,f,g,h;
  6. a=1;
  7. b=1;
  8. c=1;
  9. d=0;
  10. e=1;
  11. f=1;
  12. g=1;
  13. h=0;
  14.  
  15. int p2(int n)
  16. {
  17.     int ae=0;
  18.     res=
  19.     while(n>0)
  20.     {
  21.         if(n%2==1)
  22.             res=res*a;
  23.         a=a*a;
  24.         n=n/2;
  25.     }
  26.     return res;
  27. }
  28.  
  29. int main()
  30. {
  31.      int n;
  32.      cin >> n;
  33.      cout << fib(n)%123456789;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement