蓝桥杯——矩形切割

#include<iostream>
using namespace std;
int main(){
    int a=2019,b=324;
    int res=0;
    while(a!=b){
        if(a-b>b){
            a-=b;
            res++;
        }else{
            int t=a;
            a=b;
            b=t-b;
            res++;
        }
    }
    cout<<res+1<<endl;
    return 0;
}
posted @ 2020-10-11 17:13  进化の程序猿  阅读(206)  评论(0编辑  收藏  举报