扩张欧几里得(GCD)

参考博客链接:https://www.cnblogs.com/ray-coding-in-rays/p/6188307.html

51nod:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1011

 1 #include<stdio.h>
 2 int GCD(int a,int b)
 3 {
 4     return b?GCD(b,a%b):a;
 5 }
 6 int main()
 7 {
 8     int a,b;
 9     scanf("%d%d",&a,&b);
10     int c=GCD(a,b);
11     printf("%d\n",c);
12 }

 

posted @ 2018-07-13 13:09  jealous-boy  阅读(55)  评论(0)    收藏  举报