yeon
yeon I am a Korean web programmer with bboy dancing as a hobby. :)

Find Angle MBC

Find Angle MBC

hacker rank


Python Practice


Find Angle MBC



Input Format


The first line contains the length of side AB. The second line contains the length of side BC.


Output Format


Output <MBC in degrees.


Note: Round the angle to the nearest integer.


Examples: If angle is 56.5000001°, then output 57°. If angle is 56.5000000°, then output 57°. If angle is 56.4999999°, then output 56°.


Sample Input

1
2
10
10


Sample Output

1
45°



My code


1
2
3
4
5
6
7
from math import atan2
from math import degrees

ab = float(input())
bc = float(input())

print(str(round(degrees(atan2(ab, bc)))) + '°')



Hacker Rank > Python > math > Find Angle MBC

comments powered by Disqus