#include #include int divisor(int a,int b){ int r; while ((r=a%b)!=0) {a=b;b=r;} return b;}int multiple(int a,int b){ int d; d=divisor(a,b); return a*b/d;}void main(){ int a,b,c; clrscr(); printf("I... Read More
#include #include void hanoi(int,int,int,int);void main(){ int n; clrscr(); printf("Input n:"); scanf("%d",&n); hanoi(n,1,2,3);}void hanoi(int n,int a,int b,int c){ if (n==1) printf("%d-%d",a,c); ... Read More
int gcd(int m,int n){ int g; if (n==0) g=m; else g=gcd(n,m%n) return g;}void main(){ int m,n; scanf("%d,%d",&m,&n); printf("gcd=%d",gcd(m,n));} Read More
#include #include long fac(int);long comb(int n,int m);void main(){ int n,m; long result; clrscr(); scanf("%d,%d",&n,&m); result=comb(n,m); /**//*调用组合函数*/ printf("%ld",result);}long fac(int k... Read More