题解 | #牛牛的排列数#
牛牛的排列数
https://www.nowcoder.com/practice/9ca1c236cdbf46da9e08e1f510808625
给大家展示一个笨方法
#include <stdio.h> int main() { long n, m; scanf("%ld %ld", &n, &m); long up = 1; long down = 1; if(n > m) { m = n - m; for(up = 1; n > 1; n--) { up *= n; } for(down = 1; m > 1; m--) { down *= m; } } else { up = 0; } printf("%ld", up / down); return 0; }