#include <stdio.h>
int ret(int x, int y)
{
int i,a=1,b=1,c=1,z;
for (i = 1; i <= x; i++)
{
a =a * i;
}
for (i = 1; i <= y; i++)
{
b= b * i;
}
for (i = 1; i <= x-y; i++)
{
c = c * i;
}
z = a / (b * c);
return z;
}
int main()
{
int n, m,z;
printf("请输入n,m:");
scanf_s("%d %d", &n, &m);
if (n < m)
printf("输入错误,请重新输入。");
else
{
int ret(int x, int y);
z = ret(n, m);
printf("从%d个中选%d个有%d种方式", n, m, z);
}
return 0;
}