怎么做啊

凌艺樽  •  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;
}

评论:

endl改成'\n'就行了,相信我


廖悦扬  •  3个月前

巨佬!!!


凌艺樽  •  3个月前

拜您为师,蒟蒻膜拜


凌艺樽  •  3个月前