解题思路:
n!/(m!*(n-m)!)
注意事项:
参考代码:
import java.util.Scanner; public class C1248 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(), m = sc.nextInt(); System.out.println(F(n,m) / F(n-m,1)); } sc.close(); } private static long F(int n, int m){ if(n == m) return 1; return F(n-1, m)*n; } }
0.0分
0 人评分