03 2020 档案

摘要:1.分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) 1.1for循环 package test; public class Zuoye { public static void main(String[] args) { int sum=0 阅读全文
posted @ 2020-03-30 17:06 可爱小李没脑袋 阅读(151) 评论(0) 推荐(0)
摘要:1.编写程序,输入变量x的值,如果是1,输出x=1,如果是5,输出x=5,如果是10,输出x=10,除了以上几个值,都输出x=none。(知识点:if条件语句) package test; import java.util.Scanner; public class Zuoye { public s 阅读全文
posted @ 2020-03-26 12:05 可爱小李没脑袋 阅读(141) 评论(0) 推荐(0)
摘要:1.输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) package test; import java.util.Scanner; public class Zuoye { public static void main(String[] args) { Syste 阅读全文
posted @ 2020-03-20 17:36 可爱小李没脑袋 阅读(133) 评论(0) 推荐(0)
摘要:1.已知a,b均是整型变量,写出将a,b两个变量中的值互换的程序。 package test; public class Zuoye { public static void main(String[] args) { // TODO Auto-generated method stub int a 阅读全文
posted @ 2020-03-19 12:27 可爱小李没脑袋 阅读(119) 评论(0) 推荐(0)
摘要:package test; public class Zuoye { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("hello"); } } 阅读全文
posted @ 2020-03-07 12:12 可爱小李没脑袋 阅读(139) 评论(0) 推荐(0)