用户管理高级版

This commit is contained in:
2024-10-29 09:17:12 +08:00
parent 761fcb4905
commit 87f3d76415
5 changed files with 53 additions and 5 deletions

View File

@@ -16,7 +16,8 @@ public class Main {
case 1: // 圆形
System.out.print("请输入圆形的半径:");
double radius = sc.nextDouble();
Shape circle = new Circle(radius);
Circle circle = new Circle(radius);
// Shape circle = new Circle(radius);
ShapeCalculate.printArea(circle);
ShapeCalculate.printPerimeter(circle);
break;
@@ -24,7 +25,8 @@ public class Main {
System.out.print("请输入长方形的长和宽:");
double length = sc.nextDouble();
double width = sc.nextDouble();
Shape rectangle = new Rectangle(length, width);
// Shape rectangle = new Rectangle(length, width);
Rectangle rectangle = new Rectangle(length, width);
ShapeCalculate.printArea(rectangle);
ShapeCalculate.printPerimeter(rectangle);
break;