Input Format
The first line contains the length of side .
The second line contains the length of side .
Constraints

  • Lengths  and  are natural numbers.
Output Format
Output  in degrees.
Note: Round the angle to the nearest integer.

hackerrank find angle mbc problem solution in python programming

Problem solution in Python 3 programming language.

import cmath
import math

AB = int(input())
BC = int(input())

print(str(int(round(math.degrees(cmath.phase(complex(BC,AB))))))+'°')

Second solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
import math
a = int(input())
b = int(input())
M = math.sqrt(a**2+b**2)
theta = math.acos(b/M )
print(str(round(math.degrees(theta)))+'°')

Problem solution in Python 2 programming language.

import cmath
import math

AB = int(raw_input())
BC = int(raw_input())

print str(int(round(math.degrees(cmath.phase(complex(BC,AB))))))+'°'