Lintcode矩形面积
来源:互联网 发布:bi数据分析前景 编辑:程序博客网 时间:2024/06/05 20:49
实现一个矩阵类Rectangle
,包含如下的一些成员变量与函数:
- 两个共有的成员变量
width
和height
分别代表宽度和高度。 - 一个构造函数,接受2个参数 width 和 height 来设定矩阵的宽度和高度。
- 一个成员函数
getArea
,返回这个矩阵的面积。
样例
Rectangle rec = new Rectangle(3, 4);rec.getArea(); // should get 12
public class Rectangle {
int width;
int height;
public Rectangle(int width,int height){
this.width=width;
this.height=height;
}
public int getArea(){
return width*height;
}}
int width;
int height;
public Rectangle(int width,int height){
this.width=width;
this.height=height;
}
public int getArea(){
return width*height;
}}
阅读全文
0 0
- Lintcode矩形面积
- lintcode[122]:直方图内最大矩形面积
- 矩形面积
- lintcode-矩阵面积
- LintCode之矩阵面积
- Lintcode:矩阵面积
- 计算矩形面积
- 矩形面积并
- 最大矩形面积问题
- 【最大子矩形】面积
- 【最大子矩形】面积
- hdu3265 矩形面积并
- POJ2559 最大矩形面积
- POJ2082 最大矩形面积
- 求最大矩形面积
- 计算 矩形重叠面积
- 直方图最大面积矩形
- hdu1542 矩形面积并
- OpenCV 正面人脸检测
- PAT_A 1055. The World's Richest (25)
- 无限轮播
- 针对二分类问题的支持向量机模型
- 20170914
- Lintcode矩形面积
- C++/C++11中<iterator>的使用
- LCA 的两种算法
- HTTP 304状态码的详细讲解
- jdbc:oracle:thin:@lcoalhost:1521:orcl11解析
- 纸张尺寸
- 用 c# 来操作WORD的经验总结
- linux sed命令使用
- C语言写的循环单链表 例子简单 便于阅读和复习