ITPub博客

首页 > 应用开发 > > 为啥是“它是个1位的数!它是个2位的数!”

为啥是“它是个1位的数!它是个2位的数!”

作者:ou_159 时间:2019-11-25 11:52:34 0 删除 编辑
public static void main(String[] args) {

    int num = 999;

    int count = 0;

    for(count=1; (num/=10)>0; count++){

         System.out.print("它是个"+count+"位的数!");

     }



    }

    }


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1192/viewspace-3145250/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    117
  • 访问量
    1302