import math
class Rectangular:
def area(self, long, wide):
print(f"面积为{long * wide}")
def per(self, long, wide):
print(f"周长为{2 * (long + wide)}")
class jiao:
def area(self, a, b, c, p):
print(f"面积为{math.sqrt((p*(p-a)*(p-b)*(p-c)))}")
def per(self, a, b, c):
print(f"周长为{a+b+c}")
class jiao1(jiao):
a = int(input("边长为:"))
b = int(input("边长为:"))
c = int(input("边长为:"))
p = (a+b+c)/2
def __init__(self):
print("三角形")
class Shapes(Rectangular):
long = int(input("长为:"))
wide = int(input("宽为:"))
def __init__(self):
print("矩形")
if __name__ == "__main__":
c1 = Shapes()
c1.area(c1.long, c1.wide)
c1.per(c1.long, c1.wide)
s = jiao1()
s.area(s.a, s.b, s.c, s.p)
s.per(s.a, s.b, s.c)