摘要: 1. 打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身。例如:153是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方。(知识点:循环语句、条件语句) package the; public class newcless4 { public st 阅读全文
posted @ 2020-04-02 14:31 仙下小妖 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1. 分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) package the; public class newcless4{ public static void main(String[] args) { // 分别使用for循环,wh 阅读全文
posted @ 2020-04-01 15:46 仙下小妖 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1.编写程序, 输入变量x的值,如果是1,输出x=1,如果是5,输出x=5,如果是 10,输出 x=10,除了以上几个值,都输出x=none。(知识点:if条件语句) package the; import java.util.Scanner; public class newcless4 { pu 阅读全文
posted @ 2020-03-26 14:39 仙下小妖 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1.输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) package the; import java.util.Scanner; public class world { public static void main(String[] args) { //输入一个 阅读全文
posted @ 2020-03-21 18:52 仙下小妖 阅读(151) 评论(0) 推荐(0) 编辑
摘要: package the; public class world { public static void main(String[] args) { int a=2,b=3; int c=0; System.out.println("互换前:a="+a+" "+"b="+b); a=c; a=b; 阅读全文
posted @ 2020-03-19 12:12 仙下小妖 阅读(72) 评论(0) 推荐(0) 编辑
摘要: package the; public class world { public static void main(String[] args){ //TODO Auto-generated method stub System.out.println("The world"); } } 阅读全文
posted @ 2020-03-09 18:07 仙下小妖 阅读(62) 评论(0) 推荐(0) 编辑