摘要: 打印三角形 public static void main(String[] args) { //打印三角形 5行 for (int i = 1; i <= 5; i++) { for (int j = 5; j >=i ; j--) { System.out.print(" "); } for ( 阅读全文
posted @ 2021-02-15 15:41 鍠钺 阅读(33) 评论(0) 推荐(0)
摘要: Break和continue Break 用于强行退出循环,不执行循环中剩余的语句(break语句也可在switch语句中使用 例子: public class BreakDemo01 { public static void main(String[] args) { int i=0; while 阅读全文
posted @ 2021-02-15 10:44 鍠钺 阅读(43) 评论(0) 推荐(0)