Pagini recente » Cod sursa (job #1588902) | Cod sursa (job #984367) | Cod sursa (job #1365376) | Cod sursa (job #559913) | Cod sursa (job #373202)
Cod sursa(job #373202)
#include<cstdio>
int main()
{
freopen("multiplu.in","r",stdin);
freopen("multiplu.out","w",stdout);
int a,b;
scanf("%d%d",&a,&b);
int r=a%b,x=a,y=b;
while (r)
{
x=y;
y=r;
r=x%y;
}
int cmmmc=a*b/y;
int i=1;
bool p=false;
while (!p)
{
int x=cmmmc*i,x1=x;
while (x)
{
if (x%10!=1 && x%10!=0)
break;
x/=10;
}
i++;
if (x==0)
{
printf("%d",x1);
p=true;
return 0;
}
}
return 0;
}