WA 40分,求助大佬,有2关注
查看原帖
WA 40分,求助大佬,有2关注
1331383
CSP400pts楼主2024/8/28 11:17

Code:

#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
int gcd(int x,int y){
	if(y==0) return x;
	return gcd(y,x%y);
}
int lcm(int x,int y) {
    return x/__gcd(x,y)*y;
}
long long a,b;
int main() {
	cin>>a>>b;
	cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
	return 0;
}
2024/8/28 11:17
加载中...