凌艺樽 • 3个月前
71分代码:
#include<bits/stdc++.h>
#pragma GCC optimize(3)
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int N=1e7+10;
const int INF=0x3f3f3f3f;
long long a,b,t;
inline int READ()
{
char ch;
ch=getchar();
int tem=0,t=1;
if(!(ch>='0'&&ch<='9'))
{
t=-1;
ch=getchar();
}
for(;ch>='0'&&ch<='9';ch=getchar())
{
tem=tem*10+ch-'0';
}
return t*tem;
}
int main()
{
IOS;
t=READ();
while(t--)
{
a=READ();
b=READ();
int gcd=__gcd(a,b);
cout<<a/gcd<<"/"<<b/gcd<<endl;
}
return 0;
}
评论: