标签:int 数字反转 eve print ati enum pre col ever
public static void main(String[] args) { int i = 9876; int num = caleReverseNum(i); System.out.println(num); } /** * 时间复杂度为n的位数 */ static int caleReverseNum(int num) { int rev = 0; while (num != 0){ rev = rev * 10 + num % 10; num /= 10; } return rev; }
标签:int 数字反转 eve print ati enum pre col ever
原文地址:https://www.cnblogs.com/dongma/p/12730372.html