矩形的面积可以通过将矩形的长度乘以宽度来计算:
int length = 5; int width = 2; int area = length * width; System.out.println("矩形的面积: " + area);
亲自试一试