coderforce 527APlaying with Paper

来源:互联网 发布:郁金香运动软件下载 编辑:程序博客网 时间:2024/06/13 07:20
//题意:一张纸,居短边对折直到最后一块是正方形。问把原先的矩形分成了多少块。#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;#define LL long longint 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;}

0 0