#C14815. Iterative Factorial Calculation

    ID: 44506 Type: Default 1000ms 256MiB

Iterative Factorial Calculation

Iterative Factorial Calculation

Given a single integer \(n\), compute \(n!\) (the factorial of \(n\)) using an iterative approach. Recall that the factorial of a non-negative integer is defined as:

\( n! = \prod_{i=1}^{n} i \) with the convention that \(0! = 1\).

If \(n\) is negative, output the error message Factorial is not defined for negative integers.

inputFormat

The input consists of a single integer \(n\) read from standard input.

outputFormat

If \(n\) is non-negative, output the factorial of \(n\). Otherwise, output the error message Factorial is not defined for negative integers.

## sample
0
1