#include<iostream> #include<algorithm> #include<cstdio> using namespace std; long long a,b,c,s=0; int main(){ scanf("%lld",&a); scanf("%lld",&b); while(a>1){ if(b>a){c=a;a=b;b=c;} s+=a/b; a%=b; } if(a!=0){s+=b;} printf("%lld",s); return 0; }
标签:递归,地盘,long,划分,include,scanf,lld From: https://www.cnblogs.com/w6826301/p/17808885.html