Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int F(int n){
- if (n!=0)
- {
- if (n%2==0) return 2*F(n/2)+1;
- else return 2*F(n/2);
- }
- else return 0;
- }
- int main()
- {
- cout << F(510);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement