hard
Debug Logic Errors in Pseudocode
Identify and fix logical errors in a provided snippet of pseudocode.
📝 提示内容
Review the following pseudocode for a function intended to calculate the factorial of a number. Identify the logical error, explain why it causes the function to fail, and provide the corrected code: [Insert pseudocode with an infinite loop or off-by-one error].