Codeforces344_C(数学思维)

朱小落

关注

阅读 61

2023-05-31


题目: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;
}

 

相关推荐

精彩评论(0)

0 0 举报