LeetCode 504. Base 7
题目描述:
Given an integer, return its base 7 string representation.
Example 1:
1
2
3 Input: 100
Output: "202"Example 2:
1
2
3 Input: -7
Output: "-10"Note: The input will be in range of [-1e7, 1e7].
使用除法来进行进制转换。
1 | class Solution { |