设计思路:声明一个父类Shape并声明一个getArea()计算面积的空方法让子类Circle,Echelon,Triangle,Rectangle 继承父类的方法并根据类的不同重写getArea()方法。最后声明一个Test类实现这四个类的方法,实现时用子类赋给父类的方法实现(学以致用); 代码: ...
分类:
其他好文 时间:
2018-11-03 12:42:14
阅读次数:
257
题目: Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point ...
分类:
其他好文 时间:
2018-10-29 16:13:42
阅读次数:
158
## 1 概述函数,function,独立的,用于实现具体功能的代码块。主要目的,是代码的重用(重复使用),更好的管理代码,模块化开发。函数通常使用参数和返回值,与调用者交互数据。参数给函数传递数据,返回值,函数将处理好的数据传递给调用者。Go语言中函数被称为一等公民(first-class)。意味 ...
分类:
编程语言 时间:
2018-10-28 14:51:56
阅读次数:
179
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist ...
分类:
其他好文 时间:
2018-10-25 14:18:47
阅读次数:
165
Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 ...
分类:
其他好文 时间:
2018-10-24 10:56:01
阅读次数:
142
Python全栈开发记录只为记录全栈开发学习过程中一些难和重要的知识点,还有问题及课后题目,以供自己和他人共同查看。 知识点1:优先级:not>and 短路原则:and:如果第一个条件的结论为假,那么 and 前后两个条件组成的表达式计算结果一定为假,后面的条件计算机不会进行计算 or:如果第一个条 ...
分类:
编程语言 时间:
2018-10-23 00:13:23
阅读次数:
200
前言 最近使用dlib库的同时也会用到opencv,特别是由于对dlib库的画图函数不熟悉,都想着转换到opencv进行show。本文介绍一下两种开源库中rectangle类型之间的转换。 类型说明 opencv中cv::Rect 以及opencv中的rectangle函数: 或者 dlib中的re ...
分类:
其他好文 时间:
2018-10-22 17:49:59
阅读次数:
1863
从事金融行业,资金运算频繁,这里说下我遇到的坑....稍不留神,用户资金可能损失几十万,甚至更可怕......直接上实例吧: javascript 0.1 + 0.2 为啥不等于 0.3 ? (正确结果:0.30000000000000004) 0.8 * 7 为啥不等于 5.6 ? (正确结果:5 ...
分类:
Web程序 时间:
2018-10-13 18:40:56
阅读次数:
204
召回率(Recall),精确率(Precision),平均正确率(AP),交除并(IoU) 详见https://blog.csdn.net/syoung9029/article/details/56276567 有点代码在 https://blog.csdn.net/gubenpeiyuan/art ...
分类:
其他好文 时间:
2018-10-13 10:26:12
阅读次数:
253
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn=1e5+7; 7 int n,fr1,fr2,tl1,tl2,ans; 8 int h[maxn],l[maxn],r[maxn],... ...
分类:
其他好文 时间:
2018-10-13 02:30:36
阅读次数:
190