摘要: 1. 打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身。例如:153是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方。(知识点:循环语句、条件语句)。 public class blue { public static void main(St 阅读全文
posted @ 2020-04-02 12:47 你的名字! 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1、分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) for循环。 public class blue { public static void main(String[] args) { // TODO 自动生成的方法存根 int sum= 阅读全文
posted @ 2020-03-30 15:56 你的名字! 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1.编写程序, 输入变量x的值,如果是1,输出x=1,如果是5,输出x=5,如果是 10,输出 x=10,除了以上几个值,都输出x=none。(知识点:if条件语句) package Dsz; import java.util.*; public class Sjzy { public static 阅读全文
posted @ 2020-03-26 12:21 你的名字! 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1、输入一个年份,判断是不是闰年。 import java.util.*; public class zy { public static void main(String[] args) { // TODO 自动生成的方法存根 Scanner input=new Scanner(System.in 阅读全文
posted @ 2020-03-20 17:11 你的名字! 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 1、已知a、b 是整型,互换a、b两个变量的值。 public class blue { public static void main(String[] args) { // TODO 自动生成的方法存根 int a=10, b=5,c; c=a; a=b; b=c; System.out.pri 阅读全文
posted @ 2020-03-19 12:31 你的名字! 阅读(179) 评论(0) 推荐(0) 编辑
摘要: public class blue { public static void main(String[] args) { // TODO 自动生成的方法存根System.out.println("你好呀"); } } 阅读全文
posted @ 2020-03-13 15:19 你的名字! 阅读(103) 评论(0) 推荐(0) 编辑