日期:2014-05-20 浏览次数:20772 次
public static void main(String[] args) { System.out.println(count(2)); System.out.println(count(4)); System.out.println(count(6)); } private static Integer count(int n){ if(n == 0){ return 1; } Integer sum = 1; for(int i = n ; i >=1 ;i--){ sum *= i; } return sum; }