#include<bits/stdc++.h>
using namespace std;
int work(int a,int b,int ans)
{
if(a<b) swap(a,b);//确定a为最大值。我想的是用sort函数
return a-b==0?ans:work(a-b,b,ans+1); //当a=b的时候只需要一次操作
} //迭代的时候要有牵挂的
int main()
{
int t;cin>>t;
while(t--) //总共进行t次。
{
int a,b;cin>>a>>b;//每一次都比较两个数
if(a==0||b==0)cout<<0<<"\n";
else cout<<work(a,b,1)<<"\n";
}
return 0;
}
23 信号屏蔽
最新推荐文章于 2025-12-05 10:55:08 发布
3429

被折叠的 条评论
为什么被折叠?



