long fac(int k){ long f=1; for (int i=1;i#include long fac(int);void main(){ int k; long result; clrscr(); scanf("%d",&k); result=fac(k); printf("%ld",result);}long fac(int k){ long f=1; for (int i=1;... Read More
float power(float x,int n){ float t=1; for(int i=1;i#include float power(float,int);void main(){ float x,t; int n; clrscr(); printf("Please input x,n number:"); scanf("%f,%d",&x,&n); t=power(x,n); pri... Read More
int max(int a,int b){ int t; if (a>b) t=a; else t=b; return t;}int max(int a,int b,int c){ int t; if (a>b) if (a>c) t=a; else t=c; else if (b>c) t=b; else t=c; return t;} #include #include int... Read More
/**//*⑴a除以b,余数存于r;⑵如果r不为0,则将b的值赋给a,r的值赋给b,重复⑴;否则执行⑶⑶输出a的值,它就是最大公约数。*/#include #include int divisor(int,int);void main(){ clrscr(); int a,b,d; scanf("%d,%d",&a,&b); if (a>b) d=divisor(a,b); else ... Read More