정사각형 면적을 입력받았을 때 둘레를 출력하는 문제이다.
math 모듈의 sqrt() 함수를 사용해 한 변의 길이를 계산하고 4를 곱해 총 둘레 길이를 출력한다.
import math
area=int(input())
print(math.sqrt(area)*4)
'BOJ > Python' 카테고리의 다른 글
[BOJ/백준] 28453 - Previous Level (Python) (0) | 2024.09.04 |
---|---|
[BOJ/백준] 28248 - Deliv-e-droid (Python) (0) | 2024.09.04 |
[BOJ/백준] 32154 - SUAPC 2024 Winter (Python) (1) | 2024.09.02 |
[BOJ/백준] 20232 - Archivist (Python) (0) | 2024.09.02 |
[BOJ/백준] 18691 - Pokemon Buddy (Python) (1) | 2024.08.29 |