摘要: 1 package FushiExam; 2 3 public class Text_29 { 4 5 public static void main(String[] args) { 6 // 求3*3矩阵对角线元素之和 7 int sum=0; 8 int[][] arr= {{1,2,3},{ 阅读全文
posted @ 2020-03-17 09:49 Hey蜗牛 阅读(962) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 import java.util.*; 3 public class Text_28 { 4 5 public static void main(String[] args) { 6 // 对10个数进行排序(冒泡排序) 7 Scanner scan=n 阅读全文
posted @ 2020-03-17 09:48 Hey蜗牛 阅读(2359) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 3 public class Text_27 { 4 5 public static void main(String[] args) { 6 // 求100以内的素数 7 System.out.println("输出100以内的素数:"); 8 for 阅读全文
posted @ 2020-03-17 09:45 Hey蜗牛 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 import java.util.*; 3 public class Text_26 { 4 5 public static void main(String[] args) { 6 /* 7 * 请输入星期几的第一个字母来判断一下星期几, 8 * 第一 阅读全文
posted @ 2020-03-17 09:42 Hey蜗牛 阅读(630) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 import java.util.*; 3 public class Text_25 { 4 5 public static void main(String[] args) { 6 //一个5位数,判断它是不是回文数。 7 //即 12321是回文数, 阅读全文
posted @ 2020-03-14 13:15 Hey蜗牛 阅读(646) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 import java.util.*; 3 public class Text_24 { 4 5 public static void main(String[] args) { 6 // 给一个不多于5位的正整数,要求:求它是几位数,逆序打印各位数 7 阅读全文
posted @ 2020-03-14 13:12 Hey蜗牛 阅读(855) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 3 public class Text_23 { 4 5 public static void main(String[] args) { 6 /* 7 * 有5个人坐在一起,问第5个人(小红)多少岁? 8 * 小红说 他比(第四人)大2岁, 9 * ( 阅读全文
posted @ 2020-03-14 13:09 Hey蜗牛 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 import java.util.*; 3 public class Text_22 { 4 5 public static void main(String[] args) { 6 // 利用递归方法求n! 7 Scanner scan=new Sca 阅读全文
posted @ 2020-03-14 13:08 Hey蜗牛 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 3 public class Text_21 { 4 5 public static void main(String[] args) { 6 // 求1!+2!+3!+....+20!= 7 double sum=0,t;//用double定义,是因为 阅读全文
posted @ 2020-03-14 13:06 Hey蜗牛 阅读(532) 评论(0) 推荐(0) 编辑
摘要: 1 package FushiExam; 2 3 public class Text_20 { 4 5 public static void main(String[] args) { 6 /* 7 * 计算2/1,3/2,5/3,8/5,13/8,21/13....前20项之和 8 */ 9 do 阅读全文
posted @ 2020-03-13 21:35 Hey蜗牛 阅读(980) 评论(0) 推荐(0) 编辑