摘要: 1.使用for循环计算1-100的和,除了以3结尾的那些数 public class test { public static void main(String[] args) { // TODO Auto-generated method stub int sum=0; for(int i=1;i 阅读全文
posted @ 2021-04-13 10:56 刘德广 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 能被三整除得数 import java.util.Scanner; public class Zuoye1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method st 阅读全文
posted @ 2021-04-06 12:28 刘德广 阅读(161) 评论(0) 推荐(0) 编辑
摘要: //第一题 输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) import java.util.Scanner; public class Zuoye1 { // TODO Auto-generated constructor stub public static v 阅读全文
posted @ 2021-03-28 13:39 刘德广 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 1.给定一个0~1000的整数,求各位数的和,例如345的结果是3+4+5=12 1 public class Zuoye2 2 { 3 public static void main(String[] args) { 4 int a=345; 5 int ind=a/1000; 6 int ten 阅读全文
posted @ 2021-03-12 10:08 刘德广 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 1 public class Zuoye1 2 { 3 public static void main(String [] args) { 4 for(int a = 1;a<=3;a++){ 5 for(int b = 1;b<=(3-a);b++){ 6 System.out.print(" " 阅读全文
posted @ 2021-03-08 16:50 刘德广 阅读(47) 评论(0) 推荐(0) 编辑