![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
蓝桥杯常用Api
四叠HALF
这个作者很懒,什么都没留下…
展开
-
处理排序问题Arrays.sort()方法
1、Arrays.sort(int[] a)对数组进行从小到大排序,默认字典序排序(ASCII)2、Arrays.sort(int[] a, int fromIndex, int toIndex)后面是左闭右开的下标。对数组的a[fromIndex,toIndex-1]排序3、public static <T> void sort(T[] a,int fromIndex,int toIndex, Comparator<? super T> c)自定义排序方法,原创 2021-12-01 14:08:49 · 311 阅读 · 0 评论 -
Math函数用来处理四舍五入成整数
遇到四舍五入成整数不知道怎么做:用Math.介绍java中四舍五入函数的用法 1.Math.ceil() 2.Math.floor() 3.Math.round()1.Math.ceil()向上舍入,将数值向上舍入为最接近的整数;如3.4舍入为4.0,3.6也舍入为4.0在这里插入图片描述2.Math.floor()向下舍入,将数值向下舍入为最接近的整数;如3.4舍入为3.0,3.6舍入为3.0在这里插入图片描述3.Math.round()执行标准舍入,...原创 2021-12-01 12:30:10 · 2165 阅读 · 0 评论