c语言 为什么程序编译没有错 无法运行呢
#include<stdio.h>longintjf(intn){inti;longintt=1;for(i=1;i<=n;i++)t*=i;return(t);}lon...
#include <stdio.h>
long int jf(int n)
{int i;
long int t=1;
for (i=1;i<=n;i++)
t*=i;
return (t);
}
long int cmn(int m,int n)
{return (jf(m)/(jf(n)*jf(m-n)));}
int main ()
{int m,n;
printf("please enter m and n:");
scanf("%d,%d",&m,&n);
printf("%d\n",cmn(m,n));
return 0;
} 展开
long int jf(int n)
{int i;
long int t=1;
for (i=1;i<=n;i++)
t*=i;
return (t);
}
long int cmn(int m,int n)
{return (jf(m)/(jf(n)*jf(m-n)));}
int main ()
{int m,n;
printf("please enter m and n:");
scanf("%d,%d",&m,&n);
printf("%d\n",cmn(m,n));
return 0;
} 展开
展开全部
scanf("%d,%d",&m,&n) 这句,输入两个数时中间也得用逗号隔开,你可以改成scanf("%d%d",&m,&n) ,这样输入两个数时用空格隔开就行
#include <stdio.h>
long int jf(int n)
{int i;
long int t=1;
for (i=1;i<=n;i++)
t*=i;
return (t);
}
long int cmn(int m,int n)
{return (jf(m)/(jf(n)*jf(m-n)));}
int main ()
{int m,n;
printf("please enter m and n:");
scanf("%d%d",&m,&n);
printf("%d\n",cmn(m,n));
return 0;
}
如有不懂,欢迎追问!
展开全部
scanf("%d,%d",&m,&n) 这句,输入两个数时中间也得用逗号隔开,你可以改成scanf("%d%d",&m,&n) ,这样输入两个数时用空格隔开就行
1234567891011121314151617181920#include <stdio.h> long int jf(int n){int i;long int t=1;for (i=1;i<=n;i++)t*=i;return (t);} long int cmn(int m,int n){return (jf(m)/(jf(n)*jf(m-n)));} int main (){int m,n; printf("please enter m and n:"); scanf("%d%d",&m,&n); printf("%d\n",cmn(m,n)); return 0;}
如有不懂,欢迎追问!
1234567891011121314151617181920#include <stdio.h> long int jf(int n){int i;long int t=1;for (i=1;i<=n;i++)t*=i;return (t);} long int cmn(int m,int n){return (jf(m)/(jf(n)*jf(m-n)));} int main (){int m,n; printf("please enter m and n:"); scanf("%d%d",&m,&n); printf("%d\n",cmn(m,n)); return 0;}
如有不懂,欢迎追问!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询