提交时间:2023-10-07 13:26:20
运行 ID: 105563
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; scanf("%d%d",&a,&b); int cnt = 0; if(a == b){ printf("1"); return 0; } while(a != 0 && b != 0){ if(a > b){ cnt += a/b; a = a%b; }else if(b > a){ cnt += b/a; b = b%a; } } printf("%d",cnt); return 0; }