程式:   http://codepad.org/x34NnQiv 
题目:   http://codepad.org/IQnZDRNO 

解决方案 »

  1.   

    因为你的答案不符合题目要求啊!!!
    要求:
    Note: n! means the factorial of n.
    where n and k are integers and n > k.Write a Java application that performs the following functions:(i) prompt the user using a JOptionpane to input n and k, where n <= 10 and k <= 9
    (ii) check that n <= 10 and n <= 9 and n > k; re-prompt the user if any input value is invalid
    (iii) use a recursive method to calculate the factorials of n and k
    (iv) calculate the value of the combination function C(n, k)
    (v) display the results via an JOptionpane
    注意第三条要求: 翻译一下:请使用递归方法计算……懂了吗?
      

  2.   


    你不知道什么是递归算法吗???google一下吧!三言两语还说不清。。而且你想的那个答案有点太那个了Java讲究思想你的程序完全没有体现出面向对象的思想。。有待加强啊!!!
      

  3.   

    引用 2 楼 gentleboy2009 的回复:
    因为你的答案不符合题目要求啊!!!
    [/Quote]
    >>>>   http://codepad.org/8smMtvaA用了循环....但为什么是"0"
      

  4.   

    >>>>   http://codepad.org/8smMtvaA用了循环....但为什么是"0"
    [/Quote]什么是0?