题解 | #重载运算符#
重载运算符
https://www.nowcoder.com/practice/7b1e4ffc39604be3b15959ce329da490
from math import radians, sin class Angle: def __init__(self, degrees): self.degrees = degrees def __sub__(self, other): return Angle(self.degrees - other.degrees) def sine(self): return sin(radians(self.degrees)) for _ in range(int(input())): angle1, angle2 = map(int, input().split()) a1, a2 = Angle(angle1), Angle(angle2) print("{:.2f}".format((a1 - a2).sine()))