Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: "202" Example 2: Input: -7 Output: "-10" Note: The input will be in range of [-1e7, 1e7]. 给定一个整数,将其转化为7进制,并以字符串形式输出. 示例 1: 输入: 100 输出: "202&q…
public class Solution { public string ConvertToBase7(int num) { ? "" : "-"; var list = new List<string>(); StringBuilder sb = new StringBuilder(); num = Math.Abs(num); do { ; sb.Append(n.ToString()); num = num / ; } ); var result…