题目描述
已知两个整数a和b的最大公约数是x它们的最小公倍数是y,给定 x和y,求所有可能的对(a,b)。
输入格式
输入共一行,包含整数 x 和 y (1≤x,y≤10^14 )。
输出格式
输出一系列 a 和 b 的可能配对,首先按 a 的递增顺序排列,在具有相同 a 的配对中,按 b 的递增顺序排列。
#include<bits/stdc++.h>
using namespace std;
int n,m;
int g(int x,int y){
if(y==0)return x;
else return g(y,x%y);
}
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin>>n>>m;
if(n==m)cout<<n<<" "<<m;
else{
}
return 0;
}
求助大佬,玄关!