C++ Solution || Beats 100% || Runtime 0ms ||
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string convertToBase7(int num) {\n\n    int ans = 0;\n    int i = 0;\n\n    while (num != 0)\n    {\n        int rem = num % 7;\n        ans = ans + rem * pow(10, i);\n        i++;\n        num = num / 7;\n    }\n    cout << ans << endl;\n    string Ans;\n    Ans = to_string(ans);\n    return Ans;\n\n    }\n};\n```
['C++']