早教吧作业答案频道 -->其他-->
#includeintmain(void){intjc(intn);inty=0,n=0;printf("inputanintegernumber\n");scanf("%d",&n);y=jc(n);printf("%d",y);return0;}intjc(intn){intf;f=n*jc(n-1);return(f);}求“n!”
题目详情
#include
int main(void)
{
int jc(int n);
int y=0,n=0;
printf("input aninteger number\n");
scanf("%d",&n);
y=jc(n);
printf("%d",y);
return 0;
}
int jc(int n)
{
int f;
f = n*jc(n-1);
return (f);
}
求“n!”
int main(void)
{
int jc(int n);
int y=0,n=0;
printf("input aninteger number\n");
scanf("%d",&n);
y=jc(n);
printf("%d",y);
return 0;
}
int jc(int n)
{
int f;
f = n*jc(n-1);
return (f);
}
求“n!”
▼优质解答
答案和解析
int main(void)
{
int jc(int n);
int y=0,n=0;
printf("input aninteger number\n");
scanf("%d",&n);
y=jc(n);
printf("%d\n",y);
return 0;
}
int jc(int n)
{
int f;
if(n==0||n==1)
f=1;
else
f = n*jc(n-1);
return (f);
}
阶乘那个函数有问题,修改了:
#includeint main(void)
{
int jc(int n);
int y=0,n=0;
printf("input aninteger number\n");
scanf("%d",&n);
y=jc(n);
printf("%d\n",y);
return 0;
}
int jc(int n)
{
int f;
if(n==0||n==1)
f=1;
else
f = n*jc(n-1);
return (f);
}
看了 #includeintmai...的网友还看了以下:
在线等TA)");fprintf(fp,"\r\szAPImovedi,[ebx]i*i*ij*j 2020-05-23 …
关于continue的用法疑问://animal.c#include#includeintmain 2020-06-04 …
请读程序:则下面程序的输出结果是m=1234.123;printf=("%-8.3f\n",m); 2020-07-18 …
)以下程序运行后,输出结果是A)49.5B)9.5C)22.0D)45.0#include#def 2020-07-22 …
C语言斐波那契数列求和问题#include<stdio.h>intf(intn);voidmain 2020-07-23 …
#include"stdio.h"#include"math.h"#include"stdlib. 2020-07-23 …
#includeintmain(void){intjc(intn);inty=0,n=0;prin 2020-07-23 …
三道C语言题,请高手指点第一道:#includedoublef(intn){inti;double 2020-07-23 …
VB求eX=1+x/1!+x2/2!+X3/3!……帮忙具体解释下下面的代码Dimx,s,i,jc, 2020-11-01 …
这是两个大数相加请帮忙改成两个大数相减#include#includeusingnamespaces 2020-11-23 …