dian wo
思路我就不想多说了,相信大家都知道,是因为程序出bug了才来看的,代码:
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<cstdio>
#include<iomanip>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
int f(int m,int n)
{
int a;
if(m%n==0)
{
return n;
}
else
{
return f(n,m%n);
}
}
int main()
{
int n,i,m;
cin>>m>>n;
cout<<"gcd="<<f(m,n);
return 0;
}
//点个赞,你和我都上分,难道不好么?