gcd模板题

https://ac.nowcoder.com/acm/contest/5634/B

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 typedef long long ll;
 4 ll gcd(ll a,ll b)
 5 {
 6     return b?gcd(b,a%b):a;
 7 
 8 }
 9 int main()
10 {
11     ll a,b;
12     string tmp;
13     cin>>a>>b>>tmp;
14     printf("%lld\n",gcd(a,b));
15     return 0;
16 }

 

posted @ 2020-05-13 20:47  古比  阅读(109)  评论(0编辑  收藏  举报