C语言实现二项式定理
#include#include #include //阶乘int factorial(int i){ if(i==1 || i==0) return 1; else return i*factorial(i-1);}//排列数公式int C(int n,int k){ return factorial(n)/(factorial(k)*factorial(n-k));}int main(){ int n=3,a=1,x=2; int result =0; for (k=0;k