c语言题改错#include long fun ( int k) { if k > 0 return (k*fun(k-1)); else if ( k=0 ) return 1L} main() { int k = 10 ; printf("%d!=%ld\n",k,fun ( k )) ; }给定程序mod1.c中函数fun的功能是:求n!,例如:给n输入5,则输出120.000000
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/04 08:43:48
c语言题改错
#include
long fun ( int k)
{ if k > 0
return (k*fun(k-1));
else if ( k=0 )
return 1L
}
main()
{ int k = 10 ;
printf("%d!=%ld\n",k,fun ( k )) ;
}
给定程序mod1.c中函数fun的功能是:求n!,例如:给n输入5,则输出120.000000.请改正程序中的错误,然后让k=10使程序能输出正确的结果.
注意:不能改动main函数;不得增行、删行;不得更改程序的结构.
#include
long fun ( int k)
{ if ( k > 0) //少小括号.
return (k*fun(k-1));
else if ( k=0 )
return 1L;//少分号.
}
main()
{ int k = 10 ;
printf("%d!=%ld\n",k,fun ( k )) ;
}
编译无问题了.
c语言题改错#include long fun ( int k) { if k > 0 return (k*fun(k-1)); else if ( k=0 ) return 1L} main() { int k = 10 ; printf(%d!=%ld
,k,fun ( k )) ; }给定程序mod1.c中函数fun的功能是:求n!,例如:给n输入5,则输出120.000000
c语言改错题,马上的交的作业.#include#include#define M 20void fun(char t[]){char c;int i,j;for(i=strlen(t);i;i--)for(j=0;j
C语言改错题...#include #define N 10;float max(float a[], int n);void main(){ float data[N]; int i; for(i=0;i
怎么做C语言程序改错题
求一道C语言改错题
C语言改错题目
c语言求改错#include typedef struct Birthday{short year;short month;short day;}Bir;typedef struct Student{char name[10];long ID;Bir birthday;float height;float weight;}STU;STU MyClass[5];void StudyStructMem(){printf( size Addr0 Addr1 Addr2
C语言题目一道求解#include
C语言程序改错题,#include stdio.hint yanghui(int x,int y)main(){int i,j,n;clrscr();printf(Input the row of the yanahui:
);scanf(%d,&n);for (i=1;i
c 语言编程关于求三角形面积.#include #include main(){long float a ,b,c,d,e,area;printf(input three numbers :
);Loop:scanf (%lf %lf %lf,&a,&b,&c);e=(a>b?b:a);if((e+c
c语言算法框图求 小型通讯录那道题的算法框图 #include #include #define N 100
在C语言中(long
这个c语言编程每一句都甚么意思?#include #include #include
计算机二级C语言改错题里的是什么意思啊?
C语言改错题,好急,求各路大神指导
请高手帮我做一道c语言改错题.
C语言 编程计算1!+2!+3!+…+20!.#include void main(){long t=1,s=0;int n;for(n=1;n
关于C语言编程计算1!+2!+3!+…+20!.#include void main(){long t=1,s=0;int n;for(n=1;n