您当前的位置: 首页 >  c++

令狐掌门

暂无认证

  • 1浏览

    0关注

    513博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C++求最大公约数

令狐掌门 发布时间:2018-04-09 09:03:00 ,浏览量:1

#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             
关注
打赏
1652240117
查看更多评论
0.0399s