Koala - 16기/코딩테스트 기초 스터디
[백준/Python] 10872번: 팩토리얼
joo-nick
2024. 11. 17. 21:47
문제
https://www.acmicpc.net/problem/10872
Algorithm
반복문을 사용해서 1부터 N 까지 곱해준다.
Code
n = int(input())
result = 1
if n > 0:
for i in range(1, n+1):
result *= i
print(result)