Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1147990
  • 博文数量: 241
  • 博客积分: 4385
  • 博客等级: 上校
  • 技术积分: 2383
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-07 23:13
文章分类

全部博文(241)

文章存档

2013年(1)

2012年(8)

2011年(62)

2010年(109)

2009年(61)

分类: C/C++

2009-07-29 09:17:07

#include
#include
using namespace std;
 
int GetGcd(unsigned long int a,unsigned long int b)
{
    assert((a>0)&&(b>0));
 
    unsigned long int temp;
    while(a%b!=0)
    {
        temp=a%b;
        a=b;
        b=temp;
    }
    return b;
}
 
int main()
{
    unsigned long int x,y;
    unsigned long int gcd;
    cout<<"Please input two integers:"<
    cin>>a>>b;
 
    gcd=GetGcd(x,y);
    cout<
    return 0;
}
 
   
   
 
   
   
阅读(1185) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~