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