求一java函数,数值取10的整数倍

2025-03-03 19:44:22
推荐回答(1个)
回答1:

public static void x(int x){
        if(x%10 != 0)
            x = x + (10 - x%10) ;
        
        System.out.println(x) ;
    }