Chinaunix首页 | 论坛 | 博客
  • 博客访问: 545173
  • 博文数量: 252
  • 博客积分: 1068
  • 博客等级: 少尉
  • 技术积分: 1775
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-05 21:33
文章分类

全部博文(252)

文章存档

2013年(21)

2012年(231)

分类:

2012-06-04 14:38:05

#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;
}
 
   
   
 
   
   
阅读(255) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~