Saleh127

timus1079

Mar 6th, 2020
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main ()
  4. {
  5. int a[200000],b,c,d,e,f,i,j,k,l,m;
  6. a[0]=0;
  7. a[1]=1;
  8. for(i=0;i<=10000;i++)
  9. {
  10. a[2*i]=a[i];
  11. a[2*i+1]=a[i]+a[i+1];
  12. }
  13. while(1)
  14. {
  15. c=0;
  16. cin>>b;
  17. if(b==0) break;
  18. for(i=0;i<=b;i++)
  19. {
  20. c=max(c,a[i]);
  21. }
  22. cout<<c<<endl;
  23. }
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment