Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Forensics
- wargame
- 문자열
- Digital Forensics
- Web Hacking
- cryptography
- 써니나타스
- 그리디 알고리즘
- 백준
- 구현
- MySQL
- 수학
- Text
- Python
- Network
- writeup
- Incognito
- Web
- misc
- xcz.kr
- php
- HackCTF
- N0Named
- Database
- CTF
- SuNiNaTas
- 사칙연산
- C
- 정렬
- 인코그니토
Archives
- Today
- Total
보안을 그리다, 훈이
[Baekjoon/Python3] 4153번 직각삼각형 본문
[Baekjoon/Python3] 4153번 직각삼각형
4153번: 직각삼각형
입력은 여러개의 테스트케이스로 주어지며 마지막줄에는 0 0 0이 입력된다. 각 테스트케이스는 모두 30,000보다 작은 양의 정수로 주어지며, 각 입력은 변의 길이를 의미한다.
www.acmicpc.net
# ** 연산자 사용시
while True:
nums = list(map(int, input().split()))
if 0 in nums:
break
else:
nums.sort()
if nums[2] ** 2 == nums[0] ** 2 + nums[1] ** 2:
print('right')
else:
print('wrong')
# pow() 함수 사용시
while True:
nums = list(map(int, input().split()))
if 0 in nums:
break
else:
nums.sort()
if pow(nums[2], 2) == pow(nums[0], 2) + pow(nums[1], 2):
print('right')
else:
print('wrong')
'Programming > Python & Data Structures' 카테고리의 다른 글
[Baekjoon/Python3] 4458번 첫 글자를 대문자로 (0) | 2020.12.04 |
---|---|
[Baekjoon/Python3] 4344번 평균은 넘겠지 (0) | 2020.12.04 |
[Baekjoon/Python3] 4101번 크냐? (0) | 2020.12.04 |
[Baekjoon/Python3] 3460번 이진수 (0) | 2020.12.04 |
[Baekjoon/Python3] 3062번 수 뒤집기 (0) | 2020.12.04 |
Comments