我用vs2010编写的程序,为什么总是运行失败
#include<stdio.h>intmain(){intfac(intx);intm;inti;intj;inta;intb;intc;intd;intx;inty;...
#include <stdio.h>
int main()
{
int fac(int x);
int m;
int i;
int j;
int a;
int b;
int c;
int d;
int x;
int y;
a=3;
b=9;
c=5;
d=8;
x=b-a;
y=d-c;
i=fac(b)/(fac(a)*fac(x));
j=fac(d)/(fac(c)*fac(y));
m=1+i/j;
printf("m=%d\n",m);
getch();
return 0;
}
int fac(int x)
{
int f;
if(x<0)
printf("x<0.data error!");
else if(x==0||x==1)
f=1;
else f=fac(x-1)*x;
return(f);
} 展开
int main()
{
int fac(int x);
int m;
int i;
int j;
int a;
int b;
int c;
int d;
int x;
int y;
a=3;
b=9;
c=5;
d=8;
x=b-a;
y=d-c;
i=fac(b)/(fac(a)*fac(x));
j=fac(d)/(fac(c)*fac(y));
m=1+i/j;
printf("m=%d\n",m);
getch();
return 0;
}
int fac(int x)
{
int f;
if(x<0)
printf("x<0.data error!");
else if(x==0||x==1)
f=1;
else f=fac(x-1)*x;
return(f);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询