摘要: package com.xu.struct;import java.util.Scanner;public class IfDemo03 { public static void main(String[] args) { Scanner scanner=new Scanner(System.in) 阅读全文
posted @ 2021-05-25 06:10 寻找加油 阅读(53) 评论(0) 推荐(0)
摘要: package com.xu.struct;import java.util.Scanner;public class IfDemo01 { public static void main(String[] args) { Scanner scanner=new Scanner(System.in) 阅读全文
posted @ 2021-05-25 06:09 寻找加油 阅读(39) 评论(0) 推荐(0)
摘要: package com.xu.struct;public class ForDemo05 {//增强for循环 public static void main(String[] args) { int[] numbers={10,20,30,40,50};//定义了一个数组 for(int i=0; 阅读全文
posted @ 2021-05-25 06:07 寻找加油 阅读(52) 评论(0) 推荐(0)
摘要: package com.xu.struct;public class ForDemo03 { public static void main(String[] args) { //练习2:用while或for循环输出1-1000之间能被5整除的数,并且每行输出3个; for (int i = 0; 阅读全文
posted @ 2021-05-25 06:06 寻找加油 阅读(49) 评论(0) 推荐(0)
摘要: package com.xu.struct;public class ForDemo01 { public static void main(String[] args) { int a=1;//初始化条件 while(a<=100){ System.out.println(a);//循环体 a+= 阅读全文
posted @ 2021-05-25 06:05 寻找加油 阅读(45) 评论(0) 推荐(0)
摘要: package com.xu.struct;public class DoWhileDemo02 { public static void main(String[] args) { int a=0; while(a<0){ System.out.println(a); a++; } System. 阅读全文
posted @ 2021-05-25 06:04 寻找加油 阅读(30) 评论(0) 推荐(0)
摘要: package com.xu.struct;public class DoWhileDemo01 { public static void main(String[] args) { int i=0; int sum=0; do { sum=sum+i; i++; }while(i<=100); S 阅读全文
posted @ 2021-05-25 06:01 寻找加油 阅读(23) 评论(0) 推荐(0)
摘要: package com.xu.struct;public class ContinueDemo01 { public static void main(String[] args) { int i=0; while(i<100){ i++; if(i%10==0){ System.out.print 阅读全文
posted @ 2021-05-25 06:00 寻找加油 阅读(66) 评论(0) 推荐(0)
摘要: package com.xu.struct;public class BreakDemo01 { public static void main(String[] args) { int i=0; while(i<100){ i++; System.out.println(i); if(i==30) 阅读全文
posted @ 2021-05-25 05:59 寻找加油 阅读(37) 评论(0) 推荐(0)
摘要: package com.xu.operator;//三元运算符public class Demo08 { public static void main(String[] args) { //x ?y:z //如果x==true,则结果为y,否则结果为z int score=80; String t 阅读全文
posted @ 2021-05-24 06:13 寻找加油 阅读(34) 评论(0) 推荐(0)