Cod sursa(job #127442)
Utilizator | Data | 23 ianuarie 2008 21:57:18 | |
---|---|---|---|
Problema | Multiplu | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
# include <stdio.h>
long a,b,i,l,x;
int main ()
{
freopen ("multiplu.in","r",stdin);
freopen ("multiplu.out","w",stdout);
scanf ("%ld",&a);
scanf ("%ld",&b);
for (i=1;i<2000000;i++)
{l=0;
x=i;
while (x)
{
if (x%10!=0 && x%10!=1)
l=1;
x=x/10;
}
if (l==0)
if (i%a==0 && i%b==0)
{
printf ("%ld",i);
break;
}
}
return 0;
}