본문 바로가기

BOJ/Python

[BOJ/백준] 21335 - Another Eruption (Python)

문제 링크

면적 a인 원형의 둘레를 구하는 문제이다.

 

원의 면적 공식은 πr^2, 둘레 공식은 2πr이다.

math 모듈의 sqrt() 함수와 pi로 반지름을 구하고 둘레 공식에 대입하면 된다. 

import math

a=int(input())

radius=math.sqrt(a/math.pi)
print(2*math.pi*radius)