fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int six(int n) {
  5. if (n / 6 == 0) {
  6. return n % 6;
  7. } else {
  8. return six(n / 6)*10 + n % 6;
  9. }
  10. }
  11.  
  12.  
  13. int main() {
  14. int n;
  15. cin >> n;
  16. cout << six(n);
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5276KB
stdin
1011
stdout
4403