You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
348 B

12 months ago
int n;
int gcd(int m,int n)
{
int a;
int b;
a=m;
b=n;
int t;
int r;
if(m<n) { t=m;m=n;n=t; }
r=m%n;
while(r!=0)
{m=n; n=r; r=m%n; }
return (a*b)/n;
}
int main()
{
//newline=10;
int i;
int m;
//m = 1478;
//int t;
i=getint();
m=getint();
return gcd(i,m);
}