coderforce 527APlaying with Paper

//题意:一张纸,居短边对折直到最后一块是正方形。问把原先的矩形分成了多少块。
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define LL long long
int main()
{
    LL a,b;
    while(scanf("%lld%lld",&a,&b)!=EOF)
    {
        LL cnt=0;
        while(a!=b&&a>0&&b>0)
        {
            cnt+=a/b;
            LL c=a;
            a=b;
            b=c%b;
        }
        printf("%lld\n",cnt);
    }
    return 0;
}

你可能感兴趣的:(coderforce 527APlaying with Paper)