![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
文章平均质量分 56
studywithLily
坚持向前可达远方
展开
-
Java中的循环结构
文章目录????1.while循环????2.break???? 3.continue????4.for循环????5.do while循环????1.while循环基本语法格式:while(循环条件){循环语句;}循环条件为true,则执行循环语句;否则结束循环代码示例1:打印1~10的数字代码示例2:计算1~100的和public class TestDemo{ public static void main(String[] args){ int n=1; int r原创 2022-02-02 15:45:55 · 480 阅读 · 0 评论 -
返回参数二进制中1的个数 && IDEA断点调试讲解
一.写一个函数返回参数二进制中1的个数主要思路如下:第一种方法/** * 1.打断点:让代码走到这一步,停下来 * 2.开始调试,点击甲壳虫 */import java.util.Scanner;public class TestDemo { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); int n=scanner.nextInt()原创 2022-02-02 15:34:19 · 517 阅读 · 0 评论