Codeforces344_C(数学思维)
生活随笔
收集整理的這篇文章主要介紹了
Codeforces344_C(数学思维)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
題目:http://codeforces.com/contest/344/problem/C
?
#include <iostream> #include <string.h> #include <stdio.h> #include <math.h>using namespace std; typedef long long LL;LL a,b;int main() {cin>>a>>b;if(a>b) swap(a,b);LL ans = 0;while(b){ans += a/b;a %= b;swap(a,b);}cout<<ans<<endl;return 0; }
?
總結(jié)
以上是生活随笔為你收集整理的Codeforces344_C(数学思维)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Wiki1017(乘积最大)
- 下一篇: POJ2762(判断无向图的弱连通)