题解 | #小乐乐与进制转换#
小乐乐与进制转换
https://www.nowcoder.com/practice/242eafef2a704c0ca130d563b7b3ee2d
import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //Integer.toString(str1,str2) str1 表示要转换成字符串的数字 //str2 表示要转换成的进制 String ans = Integer.toString(n,6); System.out.print(ans); } }