标签:
#include <stdio.h> long long slove(long long a,long long b){ long long ret = 0; while(a!=b){ if(a<b){ int t = b; b = a; a = t; } if(a%b==0){ return ret+(a/b); }else{ ret+=a/b; a=a-(b*(a/b)); } } if(a==b) ret++; return ret; } int main(){ long long a,b; while(scanf("%lld %lld",&a,&b)==2){ printf("%lld\n",slove(a,b)); } return 0; }
标签:
原文地址:http://www.cnblogs.com/dick159/p/5161077.html