// 图形类Shape package d922B; public class Shape { double getArea(ShapePara x){ return x.getArea(); } double getArea(Rect y) { return y.getA()*y.getB(); } } //矩形类 package d922B; public class Rect extends Shape { private double a, b; public Rect(double a
Triangle Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Main Special Judge Submit Status PID: 27932 如图的三角形,三边边长分别为AB=a,BC=b,CA=c,并且AA’/AB=p1,BB’/BC=p2,CC’/CA=p3; 现在对于给定的a,b,c和p1,p2,p3,请你计算图中红黄绿三部分的面积.
1.图形类 package com.yfs.javase; public class Shape { //计算面积方法 public double getArea() { System.out.println("计算面积"); return 0; } } 2.圆 package com.yfs.javase; public class Circle extends Shape { private double r; public Circle(double r) { this.r =