代码如下:
<%@ page contentType="text/html;charset=GB2312" %>
<HTML>
<BODY bgclor=cyan><FONT size=1>
<%!
long continueSum(int n)
{
int sum = 0;
for ( int i = 1; i <=n; i++ )
{
sum = sum + i;
}
return sum;
}
%>
<P>1到100的连续和:<BR>
<%
long sum;
sum = continueSum(100);
out.print("" + sum);
%>
</FONT>
</BODY>
</HTML>
------------------------------
请详细解释
long continueSum(int n)
以及
<%
long sum;
sum = continueSum(100);
out.print("" + sum);
%>
语句。
绝地无双
胡子哥哥
相关分类