inverser un entier en java
while(num != 0)
{
int digit = num % 10;
reversed = reversed * 10 + digit;
num /= 10;
}
Faithful Finch
while(num != 0)
{
int digit = num % 10;
reversed = reversed * 10 + digit;
num /= 10;
}
import java.util.*;
import java.util.stream.Collectors;
int[] array = new int[] {23, 54, 12};
List<Integer> list = Arrays.stream(array).boxed().collect(Collectors.toList());
Collections.reverse(list);
array = list.stream().mapToInt(x -> x).toArray();
//array = [12,54,23]
int rev= 0;
while(num > 9)
{
rev= rev*10 + num%10;
num/= 10;
}