<%@ page contentType="text/html;charset=GB2312" %>
<HTML>
<HEAD>
<TITLE>阶乘(Factorial)</TITLE>
</HEAD>
<BODY>
<FONT size=4>
<%! 
	long Factorial(int n)
      	{
             int sum=1;
             for(int i=1;i<=n;i++) 
            	{sum=sum*i;} 
             return sum;
      	}
%>
<P>1到10之间的各数字的阶乘</P>
<%
 	long sum;
        for(int j=1;j<=10;j++)
        { 
           sum=Factorial(j);
           out.print("<BR>"+j+"!="+sum);
        }
%>
</BODY>
</HTML>
