#include int gcd(int m,int n) { if(m%n==0) printf("%d\n",n); else gcd(n,m%n); } main() { i#includeint gcd(int m,int n){if(m%n==0) printf("%d\n",n);elsegcd(n,m%n);} main(){int m,n;scanf("%d%d",&m,&n);printf("%d",gcd(n,m%n));}求m整除n
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 22:56:42
#include int gcd(int m,int n) { if(m%n==0) printf("%d\n",n); else gcd(n,m%n); } main() { i#includeint gcd(int m,int n){if(m%n==0) printf("%d\n",n);elsegcd(n,m%n);} main(){int m,n;scanf("%d%d",&m,&n);printf("%d",gcd(n,m%n));}求m整除n
#include int gcd(int m,int n) { if(m%n==0) printf("%d\n",n); else gcd(n,m%n); } main() { i
#include
int gcd(int m,int n)
{
if(m%n==0) printf("%d\n",n);
else
gcd(n,m%n);
}
main()
{
int m,n;
scanf("%d%d",&m,&n);
printf("%d",gcd(n,m%n));
}
求m整除n
#include int gcd(int m,int n) { if(m%n==0) printf("%d\n",n); else gcd(n,m%n); } main() { i#includeint gcd(int m,int n){if(m%n==0) printf("%d\n",n);elsegcd(n,m%n);} main(){int m,n;scanf("%d%d",&m,&n);printf("%d",gcd(n,m%n));}求m整除n
#include
int gcd(int m,int n)
{int g;
if(m%n==0) g=n;
else
g=gcd(n,m%n);
return (g);
}
main()
{
int m,n;
scanf("%d%d",&m,&n);
printf("%d",gcd(m,n);
}
如果改成这样,应该就没问题了