#include "stdio.h"
unsigned int Gcd(unsigned int M, unsigned int N)
{
unsigned int Rem;
while(N > 0)
{
Rem = M % N;
M = N;
N = Rem;
}
return M;
}
//测试
int main()
{
printf("Gcd for 12 and 34 :%d\n", Gcd(12, 34));
return 0;
}
笑话军事旅游美容女性百态母婴家电游戏互联网财经美女干货家饰健康探索资源娱乐学院 数码美食景区养生手机购车首饰美妆装修情感篇厨房科普动物植物编程百科知道汽车珠宝 健康评测品位娱乐居家情感星座服饰美体奢侈品美容达人亲子图库折扣生活美食花嫁风景 | 首页 |
#include "stdio.h"
unsigned int Gcd(unsigned int M, unsigned int N)
{
unsigned int Rem;
while(N > 0)
{
Rem = M % N;
M = N;
N = Rem;
}
return M;
}
//测试
int main()
{
printf("Gcd for 12 and 34 :%d\n", Gcd(12, 34));
return 0;
}