#include "stdafx.h"
#include
using namespace std;
//求最大公约数
int MaxCommonDivisor(int x, int y)
{
if (y)
{
return MaxCommonDivisor(y, x%y);
}
else
{
return x;
}
}
int main()
{
int nRet = MaxCommonDivisor(24, 36);
cout
关注
打赏
C++求最大公约数
立即登录/注册


微信扫码登录