阿里巴巴在线试题--整除

2018-05-24  本文已影响0人  ZaleJ
1.png

public class MainAli {

    static double cutF(double x){
        double yL;
        double yR;
        yL = Math.floor(x/100000)*10000;
        yR = x%10000;
        return yL+yR;
    }
    public static void main(String[] args){
        double num = 0;

        double y;
        for(double x = 100000000;x<1000000000;x+=1000){
            y=cutF(x);
            if((x%y)==0){
                num++;
            }
        }

        System.out.println(num);


    }
}


上一篇下一篇

猜你喜欢

热点阅读