首页 > 其他 > 详细

循环语句

时间:2016-01-05 12:26:26      阅读:203      评论:0      收藏:0      [点我收藏+]
public class xunhuan1 {

    public static void main(String[] args) {
        // TODO 自动生成的方法存根

        double a = 1;
double b = 0.00008; while (b < 8848) { b *= 2; a++; // System.out.println(b); } //System.out.println(b); System.out.println("一张纸折叠"+a+"次可达到珠穆拉玛峰的高度"); } }

 

public class xunhuan1 {

    public static void main(String[] args) {
        // TODO 自动生成的方法存根
int j=1;
        for(double i=0.00008;i<8848;i*=2,j++)
        {
            //System.out.println(i);
        }
        System.out.println("一张纸折叠"+j+"次可达到珠穆拉玛峰的高度");
    }

}

 

循环语句

原文:http://www.cnblogs.com/zhanghaozhe8462/p/5101873.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!