比赛 202110省实验桐柏一中普及组联赛 评测结果 AAAAAAAAAA
题目名称 分数约分 最终得分 100
用户昵称 该账号已注销 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2021-10-18 19:10:30
显示代码纯文本
#include<bits/stdc++.h>
typedef __int128 ll;
using namespace std;
ll a,b;
ll read()
{
    string c;
    ll x=0;
    cin>>c;
    int p=c.length(),cnt=0;
    while(cnt!=p)
    {
        x=x*10;
        x=x+(c[cnt]-'0');
        cnt++;
    }
    return x;
}
int print(ll x)
{
    if(x>9){
        print(x/10);}
    cout<<char(x%10+'0');
}
ll gcd(ll x,ll y)
{
    if(y==0)
    return x;
    gcd(y,x%y);
}
int main(){
    freopen("yuefen.in","r",stdin);
    freopen("yuefen.out","w",stdout);
      a=read();
      b=read();
      ll g=gcd(a,b);
      ll ans1=a/g,ans2=b/g;
      print(ans1);
      cout<<' ';
      print(ans2);
      cout<<endl;
      return 0;
}