用户管理高级版
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user