본문 바로가기

devlog_owen

검색하기
devlog_owen
프로필사진 developer_owen

  • 분류 전체보기 (132)
    • TIL (75)
    • 프로젝트 (2)
      • 영화검색 웹사이트 (2)
    • algorithm (48)
      • (js)프로그래머스 (44)
      • 자바스크립트 예제 (2)
      • (python)프로그래머스 (1)
      • (python) 민코딩 (1)
    • JS (0)
Guestbook
250x250
Notice
Recent Posts
Recent Comments
Link
  • instagram
«   2025/08   »
일 월 화 수 목 금 토
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
  • javascript
  • til
  • ㅂ
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록algorithm/(python)프로그래머스 (1)

devlog_owen

python으로 최대공약수 구하기(프로그래머스 분수의 덧셈)

기본적인 방법def gcd(a, b): for i in range(min(a, b), 0, -1): if a % i == 0 and b % i == 0: return i 유클리드 호제법 def gcd(a, b): while b > 0: a, b = b, a % b return a# ordef gcd(a, b): if a % b == 0: return b elif b == 0: return a else: return gcd(b, a % b)  **math 라이브러리 사용import matha, b = 10, 15math.gcd(a, b) # 5 라이브러리가 개충격...

algorithm/(python)프로그래머스 2024. 7. 9. 14:27
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바