Explicație:
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("date.in");
ofstream fout("date.out");
int main()
{
int a,b,c,d,x,y;
fin>>a;
fin>>b;
x=a;
y=b;
while(y!=0)
{
c=x%y;
x=y;
y=c;
}
fout<<x<<endl;
d=(a*b)/x;
fout<<d;
fin.close();
fout.close();
return 0;
}