Skip to content · ⁨본문 바로가기⁩

Factorial · ⁨계승(factorial)⁩

English

Factorial

The factorial n! is the product 1 * 2 * 3 * ... * n. By definition 0! is 1.

Start a result at 1, then multiply it by every integer from 2 up to n in a loop. (The tests keep n at most 10, so the answer fits in an int.)

한국어

계승(factorial)

n!의 계승(factorial)은 1 * 2 * 3 * ... * n의 곱입니다. 정의에 따라 0!은 1입니다.

결과를 1으로 초기화한 후, 2부터 n까지 모든 정수를 루프에서 곱합니다. (테스트는 n을 최대 10로 유지하므로, 답은 int에 들어갑니다.)

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP