class Vector:
def __init__(self, a):
self.a = a
def jia(self,c):
c1 = (self.a[ 0 ] + c.a[ 0 ])
c2 = (self.a[ 1 ] + c.a[ 1 ])
return(c1,c2)
def jian(self,c):
c1=(self.a[0] - c.a[0])
c2=(self.a[1] - c.a[1])
return(c1,c2)
def diancheng(self,c):
c1=(self.a[0] * c.a[0])
c2=(self.a[1] * c.a[1])
return(c1,c2)
if __name__=="__main__":
a=eval(input("请输入向量a"))
b=eval(input("请输入向量b"))
a = Vector(a)
b = Vector(b)
print(" 加 ",a.jia(b))
print(" 减 ", a.jian(b))
print(" 点乘 ", a.diancheng(b))