public class Rectangle {
/*
* 定义两个公共变量
*/
// write your code here
public int width;
public int height;
/*
* 定义一个构造函数.
*/
// write your code here
public Rectangle(int width,int height){
this.width=width;
this.height=height;
}
/*
* 定义一个方法
* 有返回值
*/
// write your code here
public int getArea()
{
int area;
area=width*height;
return area;
}
}
求矩阵面积
最新推荐文章于 2023-02-20 13:45:58 发布