-
-
Save rightfold/17c9c5660759423c3557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program hello; | |
function factorial(n: integer): integer; | |
begin | |
if (n < 2) then | |
factorial := 1 | |
else | |
factorial := n * factorial(n - 1); | |
end; | |
var | |
n: integer; | |
begin | |
readln(n); | |
writeln(factorial(n)) | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment