首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

第十四届蓝桥杯集训——练习解题阶段(无序阶段)-基础练习 圆的面积

最近的一些文章都可能会很碎,写到哪里是哪里,过一阵子会具体的整理一遍,这里其它的类型题先往后排一排,因为蓝桥最后考的也就是对题目逻辑的理解能力,也就是dp分析能力了,所以就主要目标定在这里,最近的题目会很散,很多,基本上都是网罗全网的一些dp练习题进行二次训练,准备比赛的学生底子薄的先不建议看啊,当然,脑子快的例外,可以直接跳过之前的一切直接来看即可,只需要你在高中的时候数学成绩还可以那就没啥问题,其实,dp就是规律总结,我们只需要推导出对应题目的数学规律就可以直接操作,可能是一维数组,也可能是二维数组,总体来看二维数组的较多,但是如果能降为的话建议降为,因为如果降为起来你看看时间复杂度就知道咋回事了,那么在这里祝大家能无序的各种看明白,争取能帮助到大家。

02

java取整和java四舍五入方法

double i=2, j=2.1, k=2.5, m=2.9; System.out.println(“舍掉小数取整:Math.floor(2)=” + (int)Math.floor(i)); System.out.println(“舍掉小数取整:Math.floor(2.1)=” + (int)Math.floor(j)); System.out.println(“舍掉小数取整:Math.floor(2.5)=” + (int)Math.floor(k)); System.out.println(“舍掉小数取整:Math.floor(2.9)=” + (int)Math.floor(m)); /* 这段被注释的代码不能正确的实现四舍五入取整 System.out.println(“四舍五入取整:Math.rint(2)=” + (int)Math.rint(i)); System.out.println(“四舍五入取整:Math.rint(2.1)=” + (int)Math.rint(j)); System.out.println(“四舍五入取整:Math.rint(2.5)=” + (int)Math.rint(k)); System.out.println(“四舍五入取整:Math.rint(2.9)=” + (int)Math.rint(m)); System.out.println(“四舍五入取整:(2)=” + new DecimalFormat(“0”).format(i)); System.out.println(“四舍五入取整:(2.1)=” + new DecimalFormat(“0”).format(i)); System.out.println(“四舍五入取整:(2.5)=” + new DecimalFormat(“0”).format(i)); System.out.println(“四舍五入取整:(2.9)=” + new DecimalFormat(“0”).format(i)); */ System.out.println(“四舍五入取整:(2)=” + new BigDecimal(“2”).setScale(0, BigDecimal.ROUND_HALF_UP)); System.out.println(“四舍五入取整:(2.1)=” + new BigDecimal(“2.1”).setScale(0, BigDecimal.ROUND_HALF_UP)); System.out.println(“四舍五入取整:(2.5)=” + new BigDecimal(“2.5”).setScale(0, BigDecimal.ROUND_HALF_UP)); System.out.println(“四舍五入取整:(2.9)=” + new BigDecimal(“2.9”).setScale(0, BigDecimal.ROUND_HALF_UP));

01

Python随记(2)数据类型(小数,分数) 分支循环

整形(int) 布尔类型(bool) 浮点型(float,e记法1.5e11=1.5*10的11次方) 字符串(str)类型的获取**type()**函数type('abc') <class 'str'> **isinstance()**函数isinstance('abc',str) >>True 扩展: s 为字符串 s.isalnum() 所有字符都是数字或者字母,为真返回 True,否则返回 False。 s.isalpha() 所有字符都是字母,为真返回 True,否则返回 False。 s.isdigit() 所有字符都是数字,为真返回 True,否则返回 False。 s.islower() 所有字符都是小写,为真返回 True,否则返回 False。 s.isupper() 所有字符都是大写,为真返回 True,否则返回 False。 s.istitle() 所有单词都是首字母大写,为真返回 True,否则返回 False。 s.isspace() 所有字符都是空白字符,为真返回 True,否则返回 False常用操作符:x%y 求x除以y的余数; x//y 地板除取小的整数(3//2==1); abs(x)绝对值; dirmod(x,y)=(x//y,x%y); pow(x,y)x的y次方; complex(re,im)复数(实部,虚部); a=a+1 可化简为 a += 1 c = c*5 c *=5优先级:幂运算 >:正负号>算术操作符>比较操作符>逻辑运算符(not>and>or) not 1 or 0 and 1 or 3 and 4 or 5 and 6 or 7 and 8 and 9 ==4 ;(not 1) or (0 and 1) or (3 and 4) or (5 and 6) or (7 and 8 and 9)=0 or 0 or 4 or 6 or 9= 4

02
领券