fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int find(int n)
  5. {
  6. if(n<=1)
  7. return n;
  8.  
  9. if(n%2)
  10. return find(n/2)+n;
  11. return find(n/3)+n;
  12. }
  13.  
  14. int main() {
  15. // your code goes here
  16. cout<<find(22);
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
33