Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int factorial(int zahl)
- # Zahl ist nur für 32 bit integer
- with zahl >= 0, zahl <= 12
- # Rückgabewert ist immer größer 0
- with $ > 0
- {
- if(factorial <= 1) {
- # Die Fakultät von 0 und 1 ist als 1 definiert.
- return 1;
- } else {
- return faculty(zahl - 1) * zahl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment