摘要: 1. 分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) for循环: public class fourth { public static void main(String[] args) { int sum=0; for(int i=1; 阅读全文
posted @ 2020-04-01 08:37 梦醒117 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1.输入变量x的值,如果是1,输出x=1,如果是5,输出x=5,如果是 10,输出 x=10,除了以上几个值,都输出x=none。(知识点:if条件语句) import java.util.Scanner; public class work { public static void main(St 阅读全文
posted @ 2020-03-26 12:09 梦醒117 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1.输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) import java.util.Scanner; public class thirdwork { public static void main(String[] args) { Scanner input=n 阅读全文
posted @ 2020-03-23 15:59 梦醒117 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 1、已知a,b均是整型变量,写出将a,b两个变量中 的值互换的程序。(知识点:变量和运算符综合 应用) public class work { public static void main(String[] args) { int a=5; int b=8; int c=a; a=b; b=c; 阅读全文
posted @ 2020-03-19 11:41 梦醒117 阅读(134) 评论(0) 推荐(0) 编辑
摘要: package work1; public class wk { public static void main(String[] args) { // TODO Auto-generated method stub//printf("你好世界"); System.out.println("hell 阅读全文
posted @ 2020-03-07 12:42 梦醒117 阅读(87) 评论(0) 推荐(0) 编辑