(lintcode)第454题 矩阵面积
来源:互联网 发布:firefly ubuntu 编辑:程序博客网 时间:2024/06/05 00:10
要求:
实现一个矩阵类Rectangle
,包含如下的一些成员变量与函数:
- 两个共有的成员变量
width
和height
分别代表宽度和高度。 - 一个构造函数,接受2个参数 width 和 height 来设定矩阵的宽度和高度。
- 一个成员函数
getArea
,返回这个矩阵的面积。
代码如下:
public class Rectangle { /* * Define two public attributes width and height of type int. */ // write your code here /* * Define a constructor which expects two parameters width and height here. */ // write your code here /* * Define a public method `getArea` which can calculate the area of the * rectangle and return. */ // write your code here private int width; private int height; public Rectangle(int width,int height){ this.width=width; this.height=height; } public int getArea(){ return width*height; }}
阅读全文
0 0
- (lintcode)第454题 矩阵面积
- 【LintCode-454】矩阵面积(Java实现)
- lintcode-矩阵面积
- LintCode之矩阵面积
- Lintcode:矩阵面积
- LintCode-[入门] 454. 矩阵面积
- (lintcode)第28题 搜索二维矩阵
- 【LintCode】454.矩阵面积(入门)解题报告
- lintcode 第12题
- LintCode 第423题
- 矩阵面积
- 矩阵面积
- 矩阵面积
- 矩阵面积
- 矩阵面积
- Lintcode矩形面积
- LintCode-排序矩阵中的从小到大第k个数
- lintcode(401)排序矩阵中的从小到大第k个数
- 成为java高级工程师需要什么
- 笔记——优先队列(常用)
- 斗鱼大数据的玩法
- 星期转换Date格式错误
- Hdu_6166多源多汇最短路
- (lintcode)第454题 矩阵面积
- 【bzoj2049】[Sdoi2008]Cave 洞穴勘测
- HDU-6162---Ch’s gift (树链剖分+离线)(2017多校9)
- Echarts使用及动态加载图表数据 折线图X轴数据动态加载
- python logging
- Android进阶#(12/12)从 码农 历练成 工程师 ——综合实战_第一版从存在的问题与重构
- Glide使用详解(一)
- LeetCode 53. Maximum Subarray--连续子数组的最大和
- 使用 XHLaunchAd 快速实现app启动广告