11 2022 档案
几道简单的算法题
摘要:不能用除法,要求计算出商 和 余数 public static int[] reDiv(int a,int b){ int [] arr = new int[2]; int quotient = 0; int remainder = 0; while(a>=b){ a = a-b; quotient 阅读全文
posted @ 2022-11-23 09:22 hack2xia 阅读(42) 评论(0) 推荐(0)
随机打乱数组--java实现
摘要:参考链接 听说过 java.utils.Random 随机数是伪随机,但是Math库还没学,所以下面代码中还是用的Random public static int[] shuffle(int[] arr){ Random r = new Random(); for (int i = 1; i < a 阅读全文
posted @ 2022-11-22 23:03 hack2xia 阅读(133) 评论(0) 推荐(0)
黑马程序员 学生管理系统中的一些数据验证知识点
摘要:用户名长度必须在3-15位之间,只能是字母加数字的组合,但不能是纯数字 public static boolean checkUsername(String username) { int length = username.length(); if (length < 3 && length > 阅读全文
posted @ 2022-11-21 21:43 hack2xia 阅读(129) 评论(0) 推荐(0)