日期:2014-05-20 浏览次数:20749 次
public class Mh01
{
public static void main(String[] args)
{
int sum = 0;
for (int j = 1; j <= 20; j++)
{
sum += sumMrthod(j);
}
System.out.print("sum=" + sum);
}
public static int sumMrthod(int num01)
{
if (num01 == 1)
return 1;
return num01 * sumMrthod(num01 - 1);
}
}