为什么不行???
参考代码:
#include <iostream>
using namespace std;
int gcd(int x , int y)
{
if(!y)return x;
return gcd(y , x%y);
}
int main()
{
int a,b;
cout << "a = "; cin >> a;
cout << "b = "; cin >> b;
int c,d;
c = gcd(a,b);
d = (a * b) / c;
cout << c<< " " << d <<endl;
return 0;
}
0.0分
0 人评分