Java BigDecimal

  • + 0 comments

    import java.io.; import java.util.; import java.math.BigDecimal;

    public class Solution {

    public static void main(String[] args) { Scanner scan=new Scanner(System.in); List nums= new ArrayList<>(); for(int i=0, n=scan.nextInt();i

        nums.sort((num1, num2)->{
                BigDecimal bnum1=new BigDecimal(num1);
                BigDecimal bnum2=new BigDecimal(num2);
                return -bnum1.compareTo(bnum2);
    
        });
        for(String num: nums)
                System.out.println(num);
    

    } }

    ****