class factor                             //求n阶乘的外部服务类
   {public long factorial(long n)
       {if(n==1)   return 1;              //递归终止条件
        else return n*factorial(n-1);    //递归算法
       }
   }
    
    public class ch0316
   {  public static void main(String args[])
         { long n=20l;
           factor a=new factor();
           long result=a.factorial(n);
         System.out.println(""+n+"的阶乘结果为："+result);
     }
   }
