Program Main Implicit None Integer :: limit Do Print *, "FactorialÀ» ±¸ÇÏ°íÀÚ ÇÏ´Â ¼ö n À» ³Ö¾î¶ó" Read *, limit If (limit < 0) Then Print *, ' Your number is negative, Bye!! ' ; Exit EndIf Print *, 'The Factorial of ',limit,' is ',factorial(limit) EndDo Contains Recursive Integer Function Factorial(n) Result(fac) Integer :: n If (n==0) Then ; fac =1 Else ; fac = n*Factorial(n-1) ; Endif End Function Factorial End Program