美文网首页
阿里巴巴在线试题--整除

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

作者: ZaleJ | 来源:发表于2018-05-24 14:31 被阅读0次
    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);
    
    
        }
    }
    
    
    

    相关文章

      网友评论

          本文标题:阿里巴巴在线试题--整除

          本文链接:https://www.haomeiwen.com/subject/bqlsjftx.html