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
- PreferenceManager
- 10807
- 브루트포스
- safari world
- 2525
- 10926
- debugSymbolLevel
- BitMasking
- 개수 세기
- Counting The number
- 꼬마 정민
- 백준3085
- 25083
- 사파리 월드
- 코틀린
- 백준1107
- 디버그심볼
- 기본메신저
- 파이썬
- Class Delegation
- 새싹
- dp
- kotlin
- baekjoon
- 백준1476
- 백준
- 10430
- Android
- 1330
- 18108
Archives
- Today
- Total
목록10872 (1)
세상을 더 좋게
[백준] 10872 '팩토리얼' 파이썬(python)
https://www.acmicpc.net/problem/10872 10872번: 팩토리얼 0보다 크거나 같은 정수 N이 주어진다. 이때, N!을 출력하는 프로그램을 작성하시오. www.acmicpc.net 1. n = int(input()) res = 1 # 결과값 for i in range(1, n+1) : # for문을 이용해 계속해서 곱해간다 n이 곱해질 때까지 res *= i print(res) Point for문 사용 2. def factorial(n) : # 팩토리얼 함수 만들기 result = 1 if n > 0 : result = n * factorial(n-1) # 재귀 방식을 이용 return result n = int(input()) print(factorial(n)) Point 재..
카테고리 없음
2021. 11. 10. 00:00