03 2020 档案

摘要:1. 分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) for循环做法 public class first { public static void main(String[] args) { int sum=0; for (int i = 阅读全文
posted @ 2020-03-31 16:56 高培耀 阅读(164) 评论(0) 推荐(0)
摘要:1.编写程序, 输入变量x的值,如果是1,输出x=1,如果是5,输出x=5,如果是 10,输出x=10,除了以上几个值,都输出x=none。(知识点:if条件语句) import java.util.Scanner; public class first { public static void m 阅读全文
posted @ 2020-03-26 11:56 高培耀 阅读(128) 评论(0) 推荐(0)
摘要:1.输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) import java.util.Scanner; public class first { public static void main(String[] args) { System.out.println( 阅读全文
posted @ 2020-03-24 10:43 高培耀 阅读(97) 评论(0) 推荐(0)
摘要:public class first { public static void main(String[] args) { int a=5; int b=6; System.out.println("交换前:"+a+","+b); int c; c=a; a=b; b=c; System.out.p 阅读全文
posted @ 2020-03-19 11:31 高培耀 阅读(120) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-03-10 15:52 高培耀 阅读(68) 评论(0) 推荐(0)