public class Main {
public static void main(String[] args) {
// 使用Integer自带函数
// Integer res=Integer.valueOf(String.valueOf(2022), 9);
// 正常做法
int n=2022,res=0,count=0;
while(n>0) {
res+=(n%10)*Math.pow(9, count++);
n/=10;
}
System.out.println(res);
}
}
0 回复
0 转发
0 喜欢
1 阅读



